diff options
author | Jim Miller <jaggies@google.com> | 2010-03-01 16:51:43 -0800 |
---|---|---|
committer | Jim Miller <jaggies@google.com> | 2010-03-01 16:51:43 -0800 |
commit | 90ad1c5231946f86d4a2c6e02a72983fb1339242 (patch) | |
tree | 41dce7eab93860f37949bb3e9ea0aaafcfa5e758 | |
parent | 50bb8c4fc251552bd7ad3e8d7b7e99afafd94097 (diff) | |
download | base-90ad1c5231946f86d4a2c6e02a72983fb1339242.tar.gz |
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.
-rw-r--r-- | phone/com/android/internal/policy/impl/KeyguardUpdateMonitor.java | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/phone/com/android/internal/policy/impl/KeyguardUpdateMonitor.java b/phone/com/android/internal/policy/impl/KeyguardUpdateMonitor.java index b7187a4..b7bb184 100644 --- a/phone/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +++ b/phone/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; } } |