Merge "Avoid showing "0 minute" in the charge time label" into udc-dev am: 86f145d22a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23157339 Change-Id: I9056a79cc43085657eb02378a979ae845c693dc0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -299,9 +299,10 @@ public class BatteryInfo {
|
|||||||
(double) PowerUtil.convertUsToMs(info.remainingTimeUs), false /* withSeconds */,
|
(double) PowerUtil.convertUsToMs(info.remainingTimeUs), false /* withSeconds */,
|
||||||
true /* collapseTimeUnit */);
|
true /* collapseTimeUnit */);
|
||||||
int resId = R.string.power_charging_duration;
|
int resId = R.string.power_charging_duration;
|
||||||
info.remainingLabel = context.getString(R.string.power_remaining_charging_duration_only,
|
info.remainingLabel = chargeTimeMs <= 0 ? null : context.getString(
|
||||||
timeString);
|
R.string.power_remaining_charging_duration_only, timeString);
|
||||||
info.chargeLabel = context.getString(resId, info.batteryPercentString, timeString);
|
info.chargeLabel = chargeTimeMs <= 0 ? info.batteryPercentString
|
||||||
|
: context.getString(resId, info.batteryPercentString, timeString);
|
||||||
} else if (dockDefenderMode == BatteryUtils.DockDefenderMode.FUTURE_BYPASS) {
|
} else if (dockDefenderMode == BatteryUtils.DockDefenderMode.FUTURE_BYPASS) {
|
||||||
// Dock defender will be triggered in the future, charging will be optimized.
|
// Dock defender will be triggered in the future, charging will be optimized.
|
||||||
info.chargeLabel = context.getString(R.string.power_charging_future_paused,
|
info.chargeLabel = context.getString(R.string.power_charging_future_paused,
|
||||||
|
Reference in New Issue
Block a user