summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-01-14 19:23:48 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-01-14 19:23:48 -0800
commitfc91d73067d76e129869fe472238f4c80aa5d435 (patch)
tree8e32fe30b971f7bbb683a19aa494d38fb353951e /packages
parentc4802638d85b563df8218873504c9f9100f67e2c (diff)
parentcbfece8237cb9cf62547e75ab9572ccbf682369a (diff)
downloadframeworks_base-fc91d73067d76e129869fe472238f4c80aa5d435.zip
frameworks_base-fc91d73067d76e129869fe472238f4c80aa5d435.tar.gz
frameworks_base-fc91d73067d76e129869fe472238f4c80aa5d435.tar.bz2
am cbfece82: Merge "Switch over to getting 12-/24-hour time formats from CLDR via icu4c."
* commit 'cbfece8237cb9cf62547e75ab9572ccbf682369a': Switch over to getting 12-/24-hour time formats from CLDR via icu4c.
Diffstat (limited to 'packages')
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java14
1 files changed, 5 insertions, 9 deletions
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 e41de47..bff6cda 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/Clock.java
@@ -43,6 +43,8 @@ import java.util.Calendar;
import java.util.Locale;
import java.util.TimeZone;
+import libcore.icu.LocaleData;
+
import com.android.internal.R;
/**
@@ -137,20 +139,14 @@ public class Clock extends TextView {
private final CharSequence getSmallTime() {
Context context = getContext();
- boolean b24 = DateFormat.is24HourFormat(context);
- int res;
-
- if (b24) {
- res = R.string.twenty_four_hour_time_format;
- } else {
- res = R.string.twelve_hour_time_format;
- }
+ boolean is24 = DateFormat.is24HourFormat(context);
+ LocaleData d = LocaleData.get(context.getResources().getConfiguration().locale);
final char MAGIC1 = '\uEF00';
final char MAGIC2 = '\uEF01';
SimpleDateFormat sdf;
- String format = context.getString(res);
+ String format = is24 ? d.timeFormat24 : d.timeFormat12;
if (!format.equals(mClockFormatString)) {
/*
* Search for an unquoted "a" in the format string, so we can