File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
packages/SystemUI/src/com/android/systemui/statusbar/policy Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 4040
4141import java .text .SimpleDateFormat ;
4242import java .util .Calendar ;
43+ import java .util .Locale ;
4344import java .util .TimeZone ;
4445
4546import com .android .internal .R ;
@@ -52,6 +53,7 @@ public class Clock extends TextView {
5253 private Calendar mCalendar ;
5354 private String mClockFormatString ;
5455 private SimpleDateFormat mClockFormat ;
56+ private Locale mLocale ;
5557
5658 private static final int AM_PM_STYLE_NORMAL = 0 ;
5759 private static final int AM_PM_STYLE_SMALL = 1 ;
@@ -117,6 +119,12 @@ public void onReceive(Context context, Intent intent) {
117119 if (mClockFormat != null ) {
118120 mClockFormat .setTimeZone (mCalendar .getTimeZone ());
119121 }
122+ } else if (action .equals (Intent .ACTION_CONFIGURATION_CHANGED )) {
123+ final Locale newLocale = getResources ().getConfiguration ().locale ;
124+ if (! newLocale .equals (mLocale )) {
125+ mLocale = newLocale ;
126+ mClockFormatString = "" ; // force refresh
127+ }
120128 }
121129 updateClock ();
122130 }
You can’t perform that action at this time.
0 commit comments