masonamerica.platform.BatteryManagerPrivileged |
A privileged extension of the existing BatteryManager
.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BatteryManagerPrivileged.BatteryMode | An enumeration of all possible charge suppliers. | ||||||||||
BatteryManagerPrivileged.State | An enumeration of all possible charger/battery states. | ||||||||||
BatteryManagerPrivileged.Status | An enumeration of all possible charge status's. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the current battery level.
| |||||||||||
Get the current charging
Status
| |||||||||||
Get the current state for a given battery mode.
| |||||||||||
A corollary interface that mimics:
adb shell dumpsys reset
Allows you to "reset" the current device from any modifications done via the
BatteryManagerPrivileged interface or adb.
| |||||||||||
A corollary interface that mimics:
adb shell dumpsys battery set level
| |||||||||||
A corollary interface that mimics:
adb shell dumpsys battery set status
Status of battery/charging
| |||||||||||
A corollary interface that mimics:
adb shell dumpsys battery set
State of a given BatteryMode
| |||||||||||
A corollary interface that mimics:
adb shell dumpsys battery unplug
Allows you to "unplug" the current device from any external source.
|
Get the current battery level.
Returns | |
---|---|
int |
int that represents the battery level (between 0-100) |
Get the current charging Status
Returns | |
---|---|
BatteryManagerPrivileged.Status |
Status
|
Get the current state for a given battery mode.
Parameters | |
---|---|
mode |
BatteryManagerPrivileged.BatteryMode : The target BatteryMode |
Returns | |
---|---|
BatteryManagerPrivileged.State |
The State of the BatteryMode , State#ONLINE or
State#OFFLINE
|
A corollary interface that mimics:
adb shell dumpsys reset
Allows you to "reset" the current device from any modifications done via the
BatteryManagerPrivileged
interface or adb.
A corollary interface that mimics:
adb shell dumpsys battery set level
Parameters | |
---|---|
level |
int : The Integer value (between 0-100) of the current charge.
|
A corollary interface that mimics:
adb shell dumpsys battery set State
of a given BatteryMode
Parameters | |
---|---|
mode |
BatteryManagerPrivileged.BatteryMode : The target BatteryMode |
state |
BatteryManagerPrivileged.State : The state that the BatteryMode should be set to
|
A corollary interface that mimics: adb shell dumpsys battery unplug Allows you to "unplug" the current device from any external source.