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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user