From 91adbd3b167430dd889a21461f0461ec0c76f9ac Mon Sep 17 00:00:00 2001 From: ykhung Date: Sun, 17 Apr 2022 14:42:16 +0800 Subject: [PATCH] Use en-dash in the time range instead of a hyphen for different format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expected format: 00:00–02:00 or (2pm – 4pm) Screenshots: https://screenshot.googleplex.com/4RvaovK6RN7kjqo https://screenshot.googleplex.com/ADZRr2TPuuctFre Bug: 229264053 Test: make RunSettingsRoboTests Change-Id: Ifd9bea0ce4525c8b582778e255104e875d365563 --- .../settings/fuelgauge/BatteryChartPreferenceController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/fuelgauge/BatteryChartPreferenceController.java b/src/com/android/settings/fuelgauge/BatteryChartPreferenceController.java index 249ee492e67..02248c9af51 100644 --- a/src/com/android/settings/fuelgauge/BatteryChartPreferenceController.java +++ b/src/com/android/settings/fuelgauge/BatteryChartPreferenceController.java @@ -508,7 +508,9 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll mBatteryHistoryKeys[mTrapezoidIndex * 2], mIs24HourFormat); final String toHour = ConvertUtils.utcToLocalTimeHour(mPrefContext, mBatteryHistoryKeys[(mTrapezoidIndex + 1) * 2], mIs24HourFormat); - return String.format("%s - %s", fromHour, toHour); + return mIs24HourFormat + ? String.format("%s–%s", fromHour, toHour) + : String.format("%s – %s", fromHour, toHour); } @VisibleForTesting