diff options
Diffstat (limited to 'packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java index f95b0ae..adb5ae9 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java @@ -1,4 +1,7 @@ /* + * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * Not a Contribution. + * * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,6 +26,7 @@ import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; import android.os.UserHandle; +import android.provider.Settings; import android.text.TextUtils; import android.text.format.DateFormat; import android.util.AttributeSet; @@ -229,10 +233,20 @@ public class KeyguardStatusView extends GridLayout { : R.string.abbrev_wday_month_day_no_year); final String clockView12Skel = res.getString(R.string.clock_12hr_format); final String clockView24Skel = res.getString(R.string.clock_24hr_format); - final String key = locale.toString() + dateViewSkel + clockView12Skel + clockView24Skel; - if (key.equals(cacheKey)) return; - dateView = DateFormat.getBestDateTimePattern(locale, dateViewSkel); + if (res.getBoolean(com.android.internal.R.bool.def_custom_dateformat)) { + final String dateformat = Settings.System.getString(context.getContentResolver(), + Settings.System.DATE_FORMAT); + dateView = dateformat.equals(dateView) ? dateView : dateformat; + } else { + final String key = locale.toString() + dateViewSkel + clockView12Skel + + clockView24Skel; + if (key.equals(cacheKey)) { + return; + } + dateView = DateFormat.getBestDateTimePattern(locale, dateViewSkel); + cacheKey = key; + } clockView12 = DateFormat.getBestDateTimePattern(locale, clockView12Skel); // CLDR insists on adding an AM/PM indicator even though it wasn't in the skeleton @@ -247,7 +261,6 @@ public class KeyguardStatusView extends GridLayout { clockView24 = clockView24.replace(':', '\uee01'); clockView12 = clockView12.replace(':', '\uee01'); - cacheKey = key; } } } |