diff options
Diffstat (limited to 'src/com/android/settings/DateTimeSettings.java')
-rw-r--r-- | src/com/android/settings/DateTimeSettings.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/settings/DateTimeSettings.java b/src/com/android/settings/DateTimeSettings.java index 8a9e2ad84..34753ef04 100644 --- a/src/com/android/settings/DateTimeSettings.java +++ b/src/com/android/settings/DateTimeSettings.java @@ -40,9 +40,12 @@ import android.widget.TimePicker; import com.android.internal.logging.MetricsLogger; import com.android.settingslib.datetime.ZoneGetter; +import libcore.icu.TimeZoneNames; +import java.text.DateFormatSymbols; import java.util.Calendar; import java.util.Date; +import java.util.Locale; public class DateTimeSettings extends SettingsPreferenceFragment implements OnSharedPreferenceChangeListener, @@ -329,6 +332,16 @@ public class DateTimeSettings extends SettingsPreferenceFragment if (when / 1000 < Integer.MAX_VALUE) { ((AlarmManager) context.getSystemService(Context.ALARM_SERVICE)).setTime(when); } + updateLocaleStrings(); + } + + static void updateLocaleStrings() { + // If a device was boot up with date 1970 and then date changes to some later time, + // the wrong string might be cached if the country's zones have changed. + // See external/icu/icu4c/source/data/misc/metaZones.txt for complete mapping + TimeZoneNames.clearLocaleCache(); + Locale locale = Locale.getDefault(); + DateFormatSymbols.getInstance(locale).setZoneStrings(TimeZoneNames.getZoneStrings(locale)); } /* package */ static void setTime(Context context, int hourOfDay, int minute) { |