From 9ab788ce729f246862773a157c606f4a9d0bb0be Mon Sep 17 00:00:00 2001 From: Amin Shaikh Date: Wed, 2 May 2018 16:20:45 -0400 Subject: [PATCH] Correct night light qs tile time formatting. Change-Id: Ia290634c52fb7c02aa5080c8b1bfda1fb37c9279 Fixes: 79157944 Test: visual --- .../com/android/systemui/qs/tiles/NightDisplayTile.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java index 63be4b7f8edc6..c7191f81620c6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/NightDisplayTile.java @@ -45,8 +45,8 @@ public class NightDisplayTile extends QSTileImpl * Pattern for {@link java.time.format.DateTimeFormatter} used to approximate the time to the * nearest hour and add on the AM/PM indicator. */ - private static final String HOUR_MINUTE_DATE_TIME_PATTERN = "h a"; - private static final String APPROXIMATE_HOUR_DATE_TIME_PATTERN = "h:m a"; + private static final String PATTERN_HOUR = "h a"; + private static final String PATTERN_HOUR_MINUTE = "h:mm a"; private ColorDisplayController mController; @@ -142,9 +142,7 @@ public class NightDisplayTile extends QSTileImpl // Choose between just showing the hour or also showing the minutes (based on the // user-selected toggle time). This helps reduce how much space the label takes. toggleTimeFormat = DateTimeFormatter.ofPattern( - toggleTime.getMinute() == 0 - ? HOUR_MINUTE_DATE_TIME_PATTERN - : APPROXIMATE_HOUR_DATE_TIME_PATTERN); + toggleTime.getMinute() == 0 ? PATTERN_HOUR : PATTERN_HOUR_MINUTE); return mContext.getString(toggleTimeStringRes, toggleTime.format(toggleTimeFormat));