summaryrefslogtreecommitdiffstats
path: root/core/java/android/widget/DateTimeView.java
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2014-11-24 16:32:06 +0000
committerNarayan Kamath <narayan@google.com>2014-11-24 16:32:06 +0000
commit97ee3f7ca6ca3959f4fff4d264921c1c4e379bba (patch)
tree06cb56a543713cbf9ca070af4f862483be5a4341 /core/java/android/widget/DateTimeView.java
parent43395d677b431def5e6d8707297d590ba8f204a1 (diff)
parent98b8fe747ace27665a70ed3f910c88cb05a9853e (diff)
downloadframeworks_base-97ee3f7ca6ca3959f4fff4d264921c1c4e379bba.zip
frameworks_base-97ee3f7ca6ca3959f4fff4d264921c1c4e379bba.tar.gz
frameworks_base-97ee3f7ca6ca3959f4fff4d264921c1c4e379bba.tar.bz2
resolved conflicts for merge of 98b8fe74 to lmp-mr1-dev-plus-aosp
Change-Id: Ic2826f3be8337e72a80978e4565e0884b9ceed70
Diffstat (limited to 'core/java/android/widget/DateTimeView.java')
-rw-r--r--core/java/android/widget/DateTimeView.java21
1 files changed, 1 insertions, 20 deletions
diff --git a/core/java/android/widget/DateTimeView.java b/core/java/android/widget/DateTimeView.java
index 443884a..db17df7 100644
--- a/core/java/android/widget/DateTimeView.java
+++ b/core/java/android/widget/DateTimeView.java
@@ -156,7 +156,7 @@ public class DateTimeView extends TextView {
format = getTimeFormat();
break;
case SHOW_MONTH_DAY_YEAR:
- format = getDateFormat();
+ format = DateFormat.getDateInstance(DateFormat.SHORT);
break;
default:
throw new RuntimeException("unknown display value: " + display);
@@ -196,21 +196,6 @@ public class DateTimeView extends TextView {
return android.text.format.DateFormat.getTimeFormat(getContext());
}
- private DateFormat getDateFormat() {
- String format = Settings.System.getString(getContext().getContentResolver(),
- Settings.System.DATE_FORMAT);
- if (format == null || "".equals(format)) {
- return DateFormat.getDateInstance(DateFormat.SHORT);
- } else {
- try {
- return new SimpleDateFormat(format);
- } catch (IllegalArgumentException e) {
- // If we tried to use a bad format string, fall back to a default.
- return DateFormat.getDateInstance(DateFormat.SHORT);
- }
- }
- }
-
void clearFormatAndUpdate() {
mLastFormat = null;
update();
@@ -283,14 +268,10 @@ public class DateTimeView extends TextView {
filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED);
filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
context.registerReceiver(mReceiver, filter);
-
- final Uri uri = Settings.System.getUriFor(Settings.System.DATE_FORMAT);
- context.getContentResolver().registerContentObserver(uri, true, mObserver);
}
void unregister(Context context) {
context.unregisterReceiver(mReceiver);
- context.getContentResolver().unregisterContentObserver(mObserver);
}
}
}