Remove the comma between hour and minutes in app list.

Bug: 267184192
Fix: 267184192
Test: presubmit
Change-Id: Ic37046218ffe501600d5d247a10d3f091acf131b
This commit is contained in:
Zaiyue Xue
2023-02-03 15:25:05 +08:00
parent 1d45f7f6ed
commit 2b66ff613d
2 changed files with 11 additions and 8 deletions

View File

@@ -639,6 +639,13 @@ public class BatteryUtils {
return DockDefenderMode.DISABLED;
}
/** Formats elapsed time without commas in between. */
public static CharSequence formatElapsedTimeWithoutComma(
Context context, double millis, boolean withSeconds, boolean collapseTimeUnit) {
return StringUtil.formatElapsedTime(context, millis, withSeconds, collapseTimeUnit)
.toString().replaceAll(",", "");
}
/** Builds the battery usage time summary. */
public static String buildBatteryUsageTimeSummary(final Context context, final boolean isSystem,
final long foregroundUsageTimeInMs, final long backgroundUsageTimeInMs,
@@ -675,7 +682,7 @@ public class BatteryUtils {
if (timeInMs < DateUtils.MINUTE_IN_MILLIS) {
return context.getString(lessThanOneMinuteResId);
}
final CharSequence timeSequence = StringUtil.formatElapsedTime(
final CharSequence timeSequence = formatElapsedTimeWithoutComma(
context, (double) timeInMs, /*withSeconds=*/ false, /*collapseTimeUnit=*/ false);
return context.getString(normalResId, timeSequence);
}