| 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
BatteryManagerPrivileged.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
BatteryManagerPrivileged.Status of battery/charging
| |||||||||||
A corollary interface that mimics:
adb shell dumpsys battery set
BatteryManagerPrivileged.State of a given BatteryManagerPrivileged.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 BatteryManagerPrivileged.Status
| Returns | |
|---|---|
BatteryManagerPrivileged.Status |
BatteryManagerPrivileged.Status
|
Get the current state for a given battery mode.
| Parameters | |
|---|---|
mode |
BatteryManagerPrivileged.BatteryMode:
The target BatteryManagerPrivileged.BatteryMode |
| Returns | |
|---|---|
BatteryManagerPrivileged.State |
The BatteryManagerPrivileged.State of the BatteryManagerPrivileged.BatteryMode, ONLINE or
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 status BatteryManagerPrivileged.Status of battery/charging
| Parameters | |
|---|---|
status |
BatteryManagerPrivileged.Status:
The BatteryManagerPrivileged.Status to use for charging
|
A corollary interface that mimics:
adb shell dumpsys battery set BatteryManagerPrivileged.State of a given BatteryManagerPrivileged.BatteryMode
| Parameters | |
|---|---|
mode |
BatteryManagerPrivileged.BatteryMode:
The target BatteryManagerPrivileged.BatteryMode |
state |
BatteryManagerPrivileged.State:
The state that the BatteryManagerPrivileged.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.