Fix a keyguard charging status

Fixes a bug where the keyguard was showing
a charging state even though the device was
not plugged in.

Bug: 18166083
Change-Id: I85a2cda674ffdafb37df70598f4028414a639def
This commit is contained in:
Adrian Roos
2014-10-30 18:29:38 +01:00
parent c0f0a74762
commit ad3bc7f878
2 changed files with 3 additions and 2 deletions

View File

@@ -518,7 +518,7 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener {
* Determine whether the device is plugged in (USB, power, or wireless).
* @return true if the device is plugged in.
*/
boolean isPluggedIn() {
public boolean isPluggedIn() {
return plugged == BatteryManager.BATTERY_PLUGGED_AC
|| plugged == BatteryManager.BATTERY_PLUGGED_USB
|| plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS;

View File

@@ -162,8 +162,9 @@ public class KeyguardIndicationController {
KeyguardUpdateMonitorCallback mUpdateMonitor = new KeyguardUpdateMonitorCallback() {
@Override
public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) {
mPowerPluggedIn = status.status == BatteryManager.BATTERY_STATUS_CHARGING
boolean isChargingOrFull = status.status == BatteryManager.BATTERY_STATUS_CHARGING
|| status.status == BatteryManager.BATTERY_STATUS_FULL;
mPowerPluggedIn = status.isPluggedIn() && isChargingOrFull;
mPowerCharged = status.isCharged();
updateIndication();
}