Update battery settings remaining time format

- Update the remaining time format to align with status bar
 - Remove unused test case since no more less than 7 or 15 remaining time
   case for battery settings
 screenshots:
   https://screenshot.googleplex.com/8jPYPj7yznGFU4b.png
   https://screenshot.googleplex.com/5GYXA2tusSUVmVQ.png
   https://screenshot.googleplex.com/3EnB3ejAxAzP28q.png
   https://screenshot.googleplex.com/5jeUxwBEyHotf9d.png

Bug: 281685505
Test: make SettingsLibRoboTests
Change-Id: If33e1828582845f78d8ef666c2b74ab5bba22357
This commit is contained in:
Wesley Wang
2023-05-12 17:40:05 +08:00
parent 0af8c60342
commit 77deb463a0
2 changed files with 3 additions and 50 deletions

View File

@@ -322,18 +322,11 @@ public class BatteryInfo {
final long drainTimeUs = PowerUtil.convertMsToUs(estimate.getEstimateMillis());
if (drainTimeUs > 0) {
info.remainingTimeUs = drainTimeUs;
info.remainingLabel = PowerUtil.getBatteryRemainingStringFormatted(
info.remainingLabel = PowerUtil.getBatteryRemainingShortStringFormatted(
context,
PowerUtil.convertUsToMs(drainTimeUs),
null /* percentageString */,
false /* basedOnUsage */
);
info.chargeLabel = PowerUtil.getBatteryRemainingStringFormatted(
context,
PowerUtil.convertUsToMs(drainTimeUs),
info.batteryPercentString,
estimate.isBasedOnUsage() && !shortString
PowerUtil.convertUsToMs(drainTimeUs)
);
info.chargeLabel = info.remainingLabel;
info.suggestionLabel = PowerUtil.getBatteryTipStringFormatted(
context, PowerUtil.convertUsToMs(drainTimeUs));
} else {