summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/BatteryService.java
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2012-08-23 15:32:28 -0400
committerJohn Spurlock <jspurlock@google.com>2012-08-23 16:23:18 -0400
commit10fb224623eae3a99a4fc68424eb876eb20c3f90 (patch)
tree97639632f4baa7dc3d9e7e18ded021af3886e525 /services/java/com/android/server/BatteryService.java
parent21b53df7c3fc7501c9c9e238eb820a6dcf992650 (diff)
Disable screensavers if below first battery warning level.
Don't activate on sleep if below the threshold, and quit any currently running dream when the threshold is reached. Bug:6999949 Change-Id: I961b350d24ee6f95e502228aaa57312b0ffbadc1
Diffstat (limited to 'services/java/com/android/server/BatteryService.java')
-rw-r--r--services/java/com/android/server/BatteryService.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/java/com/android/server/BatteryService.java b/services/java/com/android/server/BatteryService.java
index 6ae16a481dcd..4192a9349f40 100644
--- a/services/java/com/android/server/BatteryService.java
+++ b/services/java/com/android/server/BatteryService.java
@@ -204,6 +204,11 @@ public class BatteryService extends Binder {
return mBatteryLevel;
}
+ // true if battery level is below the first warning threshold
+ public final boolean isBatteryLow() {
+ return mBatteryPresent && mBatteryLevel <= mLowBatteryWarningLevel;
+ }
+
void systemReady() {
// check our power situation now that it is safe to display the shutdown dialog.
shutdownIfNoPower();