Update AOD battery indication
- Divide wired and wireless charging case instead of only define wired charging case(and define wireless case as opposed) Bug: 205054467 Test: atest SystemUITests Change-Id: I10c61ab57c3864d392ef5f0dfd6bca8d641db383
This commit is contained in:
@@ -108,6 +108,15 @@ public class BatteryStatus {
|
||||
|| plugged == BatteryManager.BATTERY_PLUGGED_USB;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the device is plugged in wireless.
|
||||
*
|
||||
* @return true if the device is plugged in wireless
|
||||
*/
|
||||
public boolean isPluggedInWireless() {
|
||||
return plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not the device is charged. Note that some devices never return 100% for
|
||||
* battery level, so this allows either battery level or status to determine if the
|
||||
|
||||
@@ -138,6 +138,7 @@ public class KeyguardIndicationController {
|
||||
|
||||
private boolean mPowerPluggedIn;
|
||||
private boolean mPowerPluggedInWired;
|
||||
private boolean mPowerPluggedInWireless;
|
||||
private boolean mPowerCharged;
|
||||
private boolean mBatteryOverheated;
|
||||
private boolean mEnableBatteryDefender;
|
||||
@@ -751,10 +752,14 @@ public class KeyguardIndicationController {
|
||||
: R.string.keyguard_plugged_in;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
} else if (mPowerPluggedInWireless) {
|
||||
chargingId = hasChargingTime
|
||||
? R.string.keyguard_indication_charging_time_wireless
|
||||
: R.string.keyguard_plugged_in_wireless;
|
||||
} else {
|
||||
chargingId = hasChargingTime
|
||||
? R.string.keyguard_indication_charging_time
|
||||
: R.string.keyguard_plugged_in;
|
||||
}
|
||||
|
||||
String percentage = NumberFormat.getPercentInstance().format(mBatteryLevel / 100f);
|
||||
@@ -866,6 +871,7 @@ public class KeyguardIndicationController {
|
||||
|| status.status == BatteryManager.BATTERY_STATUS_FULL;
|
||||
boolean wasPluggedIn = mPowerPluggedIn;
|
||||
mPowerPluggedInWired = status.isPluggedInWired() && isChargingOrFull;
|
||||
mPowerPluggedInWireless = status.isPluggedInWireless() && isChargingOrFull;
|
||||
mPowerPluggedIn = status.isPluggedIn() && isChargingOrFull;
|
||||
mPowerCharged = status.isCharged();
|
||||
mChargingWattage = status.maxChargingWattage;
|
||||
|
||||
Reference in New Issue
Block a user