OSDN Git Service

Make timezone changes apply to status bar time in 24hr mode. Bug: 2632681
authorAmith Yamasani <yamasani@google.com>
Wed, 28 Apr 2010 20:20:43 +0000 (13:20 -0700)
committerAmith Yamasani <yamasani@google.com>
Wed, 28 Apr 2010 20:20:43 +0000 (13:20 -0700)
The SimpleDateFormat was being cached and new timezone not being applied. Make sure
to apply the new timezone to the format object as soon as it changes.

Change-Id: I72abfef2e14cf5db5a6e8cb71b053380b695495c

services/java/com/android/server/status/StatusBarPolicy.java

index 82050ec..94d1cb4 100644 (file)
@@ -361,6 +361,9 @@ public class StatusBarPolicy {
             else if (action.equals(Intent.ACTION_TIMEZONE_CHANGED)) {
                 String tz = intent.getStringExtra("time-zone");
                 mCalendar = Calendar.getInstance(TimeZone.getTimeZone(tz));
+                if (mClockFormat != null) {
+                    mClockFormat.setTimeZone(mCalendar.getTimeZone());
+                }
                 updateClock();
             }
             else if (action.equals(Intent.ACTION_ALARM_CHANGED)) {