Merge "Fix the charging string while charging wirelessly" into main

This commit is contained in:
Treehugger Robot
2024-08-07 03:55:07 +00:00
committed by Android (Google) Code Review

View File

@@ -92,8 +92,7 @@ public class BatteryHeaderPreferenceController extends BasePreferenceController
&& mBatterySettingsFeatureProvider.isChargingOptimizationMode(mContext)) {
return info.remainingLabel;
}
if (info.remainingLabel == null
|| info.batteryStatus == BatteryManager.BATTERY_STATUS_NOT_CHARGING) {
if (info.batteryStatus == BatteryManager.BATTERY_STATUS_NOT_CHARGING) {
return info.statusLabel;
}
if (info.pluggedStatus == BatteryManager.BATTERY_PLUGGED_WIRELESS) {
@@ -106,6 +105,9 @@ public class BatteryHeaderPreferenceController extends BasePreferenceController
return wirelessChargingLabel;
}
}
if (info.remainingLabel == null) {
return info.statusLabel;
}
if (info.statusLabel != null && !info.discharging) {
// Charging state
if (com.android.settingslib.fuelgauge.BatteryUtils.isChargingStringV2Enabled()) {