summaryrefslogtreecommitdiffstats
path: root/policy/com
diff options
context:
space:
mode:
authorJim Miller <jaggies@google.com>2010-03-01 16:51:43 -0800
committerJim Miller <jaggies@google.com>2010-03-01 16:51:43 -0800
commitcdb70af791446f050c3275bd048fe4c630d7e9ea (patch)
tree37d49ed5749a96f6f2b6497fb0d8f39ddc545c8b /policy/com
parent0d9f798e9f76b13b07ac3dee3ff90b5530f53145 (diff)
downloadframeworks_base-cdb70af791446f050c3275bd048fe4c630d7e9ea.zip
frameworks_base-cdb70af791446f050c3275bd048fe4c630d7e9ea.tar.gz
frameworks_base-cdb70af791446f050c3275bd048fe4c630d7e9ea.tar.bz2
Fix 2447470: always update the battery status when it's below the threshold.
Previously, the battery percentage was only shown when the battery level transitioned below the LOW_BATTERY_THRESHOLD (20%). This change makes it so it gets updated whenever we get a battery status update where the level is below LOW_BATTERY_THRESHOLD. Note: this only applies to the pattern unlock screen.
Diffstat (limited to 'policy/com')
-rw-r--r--policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java b/policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
index b7187a4..b7bb184 100644
--- a/policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
+++ b/policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java
@@ -385,14 +385,8 @@ public class KeyguardUpdateMonitor {
}
if (!pluggedIn) {
- // not plugged in and going below threshold
- if (batteryLevel < LOW_BATTERY_THRESHOLD
- && mBatteryLevel >= LOW_BATTERY_THRESHOLD) {
- return true;
- }
- // not plugged in and going above threshold (sounds impossible, but, meh...)
- if (mBatteryLevel < LOW_BATTERY_THRESHOLD
- && batteryLevel >= LOW_BATTERY_THRESHOLD) {
+ // not plugged in and below threshold
+ if (batteryLevel < LOW_BATTERY_THRESHOLD && batteryLevel != mBatteryLevel) {
return true;
}
}