Update string for all defenders

Test: Unit test passed
Bug: 262508668
Change-Id: Ia0126f9761caa43d0746962a9bb77173e9f45ad1
This commit is contained in:
Zhenwei Chen
2022-12-14 18:33:12 +08:00
parent e8e2d9c68f
commit 1eea27ae82
5 changed files with 20 additions and 51 deletions

View File

@@ -42,8 +42,6 @@ import com.android.settingslib.fuelgauge.EstimateKt;
import com.android.settingslib.utils.PowerUtil;
import com.android.settingslib.utils.StringUtil;
import java.text.NumberFormat;
public class BatteryInfo {
private static final String TAG = "BatteryInfo";
@@ -305,13 +303,9 @@ public class BatteryInfo {
timeString);
info.chargeLabel = context.getString(resId, info.batteryPercentString, timeString);
} else if (dockDefenderMode == BatteryUtils.DockDefenderMode.FUTURE_BYPASS) {
// Dock defender will be triggered in the future, charging will be paused at 90%.
final int extraValue = context.getResources().getInteger(
R.integer.config_battery_extra_tip_value);
final String extraPercentage = NumberFormat.getPercentInstance().format(
extraValue * 0.01f);
// Dock defender will be triggered in the future, charging will be optimized.
info.chargeLabel = context.getString(R.string.power_charging_future_paused,
info.batteryPercentString, extraPercentage);
info.batteryPercentString);
} else {
final String chargeStatusLabel = Utils.getBatteryStatus(context, batteryBroadcast,
compactStatus);