FileDocCategorySizeDatePackage
WifiDisplayStatus.javaAPI DocAndroid 5.1 API6971Thu Mar 12 22:22:10 GMT 2015android.hardware.display

WifiDisplayStatus

public final class WifiDisplayStatus extends Object implements android.os.Parcelable
Describes the current global state of Wifi display connectivity, including the currently connected display and all available or remembered displays.

This object is immutable.

hide

Fields Summary
private final int
mFeatureState
private final int
mScanState
private final int
mActiveDisplayState
private final WifiDisplay
mActiveDisplay
private final WifiDisplay[]
mDisplays
private final WifiDisplaySessionInfo
mSessionInfo
Session info needed for Miracast Certification
public static final int
FEATURE_STATE_UNAVAILABLE
Feature state: Wifi display is not available on this device.
public static final int
FEATURE_STATE_DISABLED
Feature state: Wifi display is disabled, probably because Wifi is disabled.
public static final int
FEATURE_STATE_OFF
Feature state: Wifi display is turned off in settings.
public static final int
FEATURE_STATE_ON
Feature state: Wifi display is turned on in settings.
public static final int
SCAN_STATE_NOT_SCANNING
Scan state: Not currently scanning.
public static final int
SCAN_STATE_SCANNING
Scan state: Currently scanning.
public static final int
DISPLAY_STATE_NOT_CONNECTED
Display state: Not connected.
public static final int
DISPLAY_STATE_CONNECTING
Display state: Connecting to active display.
public static final int
DISPLAY_STATE_CONNECTED
Display state: Connected to active display.
public static final Creator
CREATOR
Constructors Summary
public WifiDisplayStatus()


      
        this(FEATURE_STATE_UNAVAILABLE, SCAN_STATE_NOT_SCANNING, DISPLAY_STATE_NOT_CONNECTED,
                null, WifiDisplay.EMPTY_ARRAY, null);
    
public WifiDisplayStatus(int featureState, int scanState, int activeDisplayState, WifiDisplay activeDisplay, WifiDisplay[] displays, WifiDisplaySessionInfo sessionInfo)

        if (displays == null) {
            throw new IllegalArgumentException("displays must not be null");
        }

        mFeatureState = featureState;
        mScanState = scanState;
        mActiveDisplayState = activeDisplayState;
        mActiveDisplay = activeDisplay;
        mDisplays = displays;

        mSessionInfo = (sessionInfo != null) ? sessionInfo : new WifiDisplaySessionInfo();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public WifiDisplaygetActiveDisplay()
Gets the Wifi display that is currently active. It may be connecting or connected.

        return mActiveDisplay;
    
public intgetActiveDisplayState()
Get the state of the currently active display.

return
One of: {@link #DISPLAY_STATE_NOT_CONNECTED}, {@link #DISPLAY_STATE_CONNECTING}, or {@link #DISPLAY_STATE_CONNECTED}.

        return mActiveDisplayState;
    
public WifiDisplay[]getDisplays()
Gets the list of Wifi displays, returns a combined list of all available Wifi displays as reported by the most recent scan, and all remembered Wifi displays (not necessarily available at the time).

        return mDisplays;
    
public intgetFeatureState()
Returns the state of the Wifi display feature on this device.

The value of this property reflects whether the device supports the Wifi display, whether it has been enabled by the user and whether the prerequisites for connecting to displays have been met.

        return mFeatureState;
    
public intgetScanState()
Returns the current state of the Wifi display scan.

return
One of: {@link #SCAN_STATE_NOT_SCANNING} or {@link #SCAN_STATE_SCANNING}.

        return mScanState;
    
public WifiDisplaySessionInfogetSessionInfo()
Gets the Wifi display session info (required for certification only)

        return mSessionInfo;
    
public java.lang.StringtoString()

        return "WifiDisplayStatus{featureState=" + mFeatureState
                + ", scanState=" + mScanState
                + ", activeDisplayState=" + mActiveDisplayState
                + ", activeDisplay=" + mActiveDisplay
                + ", displays=" + Arrays.toString(mDisplays)
                + ", sessionInfo=" + mSessionInfo
                + "}";
    
public voidwriteToParcel(android.os.Parcel dest, int flags)

        dest.writeInt(mFeatureState);
        dest.writeInt(mScanState);
        dest.writeInt(mActiveDisplayState);

        if (mActiveDisplay != null) {
            dest.writeInt(1);
            mActiveDisplay.writeToParcel(dest, flags);
        } else {
            dest.writeInt(0);
        }

        dest.writeInt(mDisplays.length);
        for (WifiDisplay display : mDisplays) {
            display.writeToParcel(dest, flags);
        }

        mSessionInfo.writeToParcel(dest, flags);