WifiDisplayStatuspublic final class WifiDisplayStatus extends Object implements android.os.ParcelableDescribes the current global state of Wifi display connectivity, including the
currently connected display and all available or remembered displays.
This object is immutable.
|
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 | mSessionInfoSession info needed for Miracast Certification | public static final int | FEATURE_STATE_UNAVAILABLEFeature state: Wifi display is not available on this device. | public static final int | FEATURE_STATE_DISABLEDFeature state: Wifi display is disabled, probably because Wifi is disabled. | public static final int | FEATURE_STATE_OFFFeature state: Wifi display is turned off in settings. | public static final int | FEATURE_STATE_ONFeature state: Wifi display is turned on in settings. | public static final int | SCAN_STATE_NOT_SCANNINGScan state: Not currently scanning. | public static final int | SCAN_STATE_SCANNINGScan state: Currently scanning. | public static final int | DISPLAY_STATE_NOT_CONNECTEDDisplay state: Not connected. | public static final int | DISPLAY_STATE_CONNECTINGDisplay state: Connecting to active display. | public static final int | DISPLAY_STATE_CONNECTEDDisplay 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 int | describeContents()
return 0;
| public WifiDisplay | getActiveDisplay()Gets the Wifi display that is currently active. It may be connecting or
connected.
return mActiveDisplay;
| public int | getActiveDisplayState()Get the state of the currently active display.
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 int | getFeatureState()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 int | getScanState()Returns the current state of the Wifi display scan.
return mScanState;
| public WifiDisplaySessionInfo | getSessionInfo()Gets the Wifi display session info (required for certification only)
return mSessionInfo;
| public java.lang.String | toString()
return "WifiDisplayStatus{featureState=" + mFeatureState
+ ", scanState=" + mScanState
+ ", activeDisplayState=" + mActiveDisplayState
+ ", activeDisplay=" + mActiveDisplay
+ ", displays=" + Arrays.toString(mDisplays)
+ ", sessionInfo=" + mSessionInfo
+ "}";
| public void | writeToParcel(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);
|
|