Update battery charging status string
- Present status string only when status anomalous - Remove app usage pages divider Bug: 185448191 Bug: 187767337 Bug: 187778673 Test: make SettingsRoboTests Change-Id: I7829e9deed05fb7d95d483ddb718abfdc53b1aa6
This commit is contained in:
@@ -111,8 +111,9 @@ public class BatteryHeaderPreferenceController extends BasePreferenceController
|
||||
private CharSequence generateLabel(BatteryInfo info) {
|
||||
if (BatteryUtils.isBatteryDefenderOn(info)) {
|
||||
return null;
|
||||
} else if (info.remainingLabel == null) {
|
||||
// Present status independently if no remaining time
|
||||
} else if (info.remainingLabel == null
|
||||
|| info.batteryStatus == BatteryManager.BATTERY_STATUS_NOT_CHARGING) {
|
||||
// Present status only if no remaining time or status anomalous
|
||||
return info.statusLabel;
|
||||
} else if (info.statusLabel != null && !info.discharging) {
|
||||
// Charging state
|
||||
|
||||
@@ -46,6 +46,7 @@ public class BatteryInfo {
|
||||
public CharSequence chargeLabel;
|
||||
public CharSequence remainingLabel;
|
||||
public int batteryLevel;
|
||||
public int batteryStatus;
|
||||
public boolean discharging = true;
|
||||
public boolean isOverheated;
|
||||
public long remainingTimeUs = 0;
|
||||
@@ -238,6 +239,8 @@ public class BatteryInfo {
|
||||
== BatteryManager.BATTERY_HEALTH_OVERHEAT;
|
||||
|
||||
info.statusLabel = Utils.getBatteryStatus(context, batteryBroadcast);
|
||||
info.batteryStatus = batteryBroadcast.getIntExtra(
|
||||
BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_UNKNOWN);
|
||||
if (!info.mCharging) {
|
||||
updateBatteryInfoDischarging(context, shortString, estimate, info);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user