Add charging string V2 for settings

Apply charging string V2 for settings

Bug: 328546483
Test: Manual test

Change-Id: Ic68bf4231da81d865faa285bca97a929abe26a42
This commit is contained in:
Pajace Chen
2024-04-06 09:17:59 +08:00
committed by pajacechen
parent bae147bab3
commit 6f3c97f60a
4 changed files with 504 additions and 46 deletions

View File

@@ -86,6 +86,14 @@ public class BatteryHeaderPreferenceController extends BasePreferenceController
return info.statusLabel;
} else if (info.statusLabel != null && !info.discharging) {
// Charging state
if (com.android.settingslib.fuelgauge.BatteryUtils.isChargingStringV2Enabled()) {
return info.isFastCharging
? mContext.getString(
R.string.battery_state_and_duration,
info.statusLabel,
info.remainingLabel)
: info.remainingLabel;
}
return mContext.getString(
R.string.battery_state_and_duration, info.statusLabel, info.remainingLabel);
} else if (mPowerManager.isPowerSaveMode()) {