From 43b23c6c6920287bfdb94be9a2a2fa7028a63e28 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Thu, 29 Nov 2012 11:35:02 -0500 Subject: Flush the clock format when the locale changes. Bug: 7569120 Change-Id: If85ff36c7fac8b07f10b7077afd23255a145db1c --- .../SystemUI/src/com/android/systemui/statusbar/policy/Clock.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'packages/SystemUI/src') diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java index 8f2a4eb..e41de47 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java @@ -40,6 +40,7 @@ import android.widget.TextView; import java.text.SimpleDateFormat; import java.util.Calendar; +import java.util.Locale; import java.util.TimeZone; import com.android.internal.R; @@ -52,6 +53,7 @@ public class Clock extends TextView { private Calendar mCalendar; private String mClockFormatString; private SimpleDateFormat mClockFormat; + private Locale mLocale; private static final int AM_PM_STYLE_NORMAL = 0; private static final int AM_PM_STYLE_SMALL = 1; @@ -117,6 +119,12 @@ public class Clock extends TextView { if (mClockFormat != null) { mClockFormat.setTimeZone(mCalendar.getTimeZone()); } + } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) { + final Locale newLocale = getResources().getConfiguration().locale; + if (! newLocale.equals(mLocale)) { + mLocale = newLocale; + mClockFormatString = ""; // force refresh + } } updateClock(); } -- cgit v1.1