Modifier and Type | Class and Description |
---|---|
static class |
DeviceState.Masks |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BATTERY_LEVEL
The current battery level.
|
static java.lang.String |
BLUETOOTH_DEVICE_LIST
The list of currently scanned bluetooth device.
|
static java.lang.String |
IS_CONNECTED
Whether the current device is connected to network
|
static java.lang.String |
IS_SCREEN_ON
Whether the screen is on
|
static java.lang.String |
WIFI_AP_LIST
The list of currently scanned Wifi APs.
|
static java.lang.String |
WIFI_BSSID
The connected WiFi AP BSSID, could be null if the device is not connected to WiFi
|
EOS, TIME_CREATED
Constructor and Description |
---|
DeviceState() |
Modifier and Type | Method and Description |
---|---|
static PStreamProvider |
asUpdates(long interval,
int mask)
Provide a live stream of device states, including bluetooth, wifi, battery level, and/or foreground apps etc.
|
containsField, equals, excludeFields, getAsBoolean, getAsDouble, getAsFloat, getAsInteger, getAsLong, getAsString, getValueByField, includeFields, isEndOfStream, setFieldValue, toDebugString, toJson, toMap, toString
@PSItemField(type=java.util.List.class) public static final java.lang.String BLUETOOTH_DEVICE_LIST
@PSItemField(type=java.util.List.class) public static final java.lang.String WIFI_AP_LIST
@PSItemField(type=java.lang.Float.class) public static final java.lang.String BATTERY_LEVEL
@PSItemField(type=java.lang.Boolean.class) public static final java.lang.String IS_CONNECTED
@PSItemField(type=java.lang.String.class) public static final java.lang.String WIFI_BSSID
@PSItemField(type=java.lang.String.class) public static final java.lang.String IS_SCREEN_ON
public static PStreamProvider asUpdates(long interval, int mask)
interval
- the interval between each two device state snapshotsmask
- the mask of device state type, could be `DeviceState.Masks.BLUETOOTH_DEVICE_LIST`, `DeviceState.Masks.WIFI_AP_LIST`, etc.