| bymason.platform.BatteryManagerPrivileged |
A privileged extension of the existing android.os.BatteryManager.
| 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 <level>
Allows you to set the battery level of current battery/charging.
| |||||||||||
A corollary interface that mimics:
adb shell dumpsys battery set status <status>
Allows you to set the
Status of battery/charging
| |||||||||||
A corollary interface that mimics:
adb shell dumpsys battery set <mode> <state>
Allowing you set the
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 <level> Allows you to set the battery level of current battery/charging.
| Parameters | |
|---|---|
level |
int: The integer value (between 0-100) of the current charge. |
A corollary interface that mimics:
adb shell dumpsys battery set <mode> <state>
Allowing you set the 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.