From 9d68b3c839046d6a0ef505ab020fc4219ea36170 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Wed, 22 Oct 2014 12:55:58 +0100 Subject: [PATCH] Remove deprecated DateFormat APIs. bug: 18074066 Change-Id: I99cef45105c9f25075c596cf4f52ec5573565596 --- api/current.txt | 13 ---- api/removed.txt | 20 ++++++ core/java/android/text/format/DateFormat.java | 68 +++++++++++++++---- 3 files changed, 73 insertions(+), 28 deletions(-) diff --git a/api/current.txt b/api/current.txt index 6851bbf36df60..1c07115b8caff 100644 --- a/api/current.txt +++ b/api/current.txt @@ -30278,19 +30278,6 @@ package android.text.format { method public static java.text.DateFormat getMediumDateFormat(android.content.Context); method public static java.text.DateFormat getTimeFormat(android.content.Context); method public static boolean is24HourFormat(android.content.Context); - field public static final deprecated char AM_PM = 97; // 0x0061 'a' - field public static final deprecated char CAPITAL_AM_PM = 65; // 0x0041 'A' - field public static final deprecated char DATE = 100; // 0x0064 'd' - field public static final deprecated char DAY = 69; // 0x0045 'E' - field public static final deprecated char HOUR = 104; // 0x0068 'h' - field public static final deprecated char HOUR_OF_DAY = 107; // 0x006b 'k' - field public static final deprecated char MINUTE = 109; // 0x006d 'm' - field public static final deprecated char MONTH = 77; // 0x004d 'M' - field public static final deprecated char QUOTE = 39; // 0x0027 '\'' - field public static final deprecated char SECONDS = 115; // 0x0073 's' - field public static final deprecated char STANDALONE_MONTH = 76; // 0x004c 'L' - field public static final deprecated char TIME_ZONE = 122; // 0x007a 'z' - field public static final deprecated char YEAR = 121; // 0x0079 'y' } public class DateUtils { diff --git a/api/removed.txt b/api/removed.txt index 89726793064c7..1b69ee8229f67 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -22,6 +22,26 @@ package android.os { } +package android.text.format { + + public class DateFormat { + field public static final deprecated char AM_PM = 97; // 0x0061 'a' + field public static final deprecated char CAPITAL_AM_PM = 65; // 0x0041 'A' + field public static final deprecated char DATE = 100; // 0x0064 'd' + field public static final deprecated char DAY = 69; // 0x0045 'E' + field public static final deprecated char HOUR = 104; // 0x0068 'h' + field public static final deprecated char HOUR_OF_DAY = 107; // 0x006b 'k' + field public static final deprecated char MINUTE = 109; // 0x006d 'm' + field public static final deprecated char MONTH = 77; // 0x004d 'M' + field public static final deprecated char QUOTE = 39; // 0x0027 '\'' + field public static final deprecated char SECONDS = 115; // 0x0073 's' + field public static final deprecated char STANDALONE_MONTH = 76; // 0x004c 'L' + field public static final deprecated char TIME_ZONE = 122; // 0x007a 'z' + field public static final deprecated char YEAR = 121; // 0x0079 'y' + } + +} + package android.view { public class View implements android.view.accessibility.AccessibilityEventSource android.graphics.drawable.Drawable.Callback android.view.KeyEvent.Callback { diff --git a/core/java/android/text/format/DateFormat.java b/core/java/android/text/format/DateFormat.java index 9fec9a1f5a31e..933bcee1199d8 100755 --- a/core/java/android/text/format/DateFormat.java +++ b/core/java/android/text/format/DateFormat.java @@ -60,27 +60,45 @@ import libcore.icu.LocaleData; * {@code SimpleDateFormat}. */ public class DateFormat { - /** @deprecated Use a literal {@code '} instead. */ + /** + * @deprecated Use a literal {@code '} instead. + * @removed + */ @Deprecated public static final char QUOTE = '\''; - /** @deprecated Use a literal {@code 'a'} instead. */ + /** + * @deprecated Use a literal {@code 'a'} instead. + * @removed + */ @Deprecated public static final char AM_PM = 'a'; - /** @deprecated Use a literal {@code 'a'} instead; 'A' was always equivalent to 'a'. */ + /** + * @deprecated Use a literal {@code 'a'} instead; 'A' was always equivalent to 'a'. + * @removed + */ @Deprecated public static final char CAPITAL_AM_PM = 'A'; - /** @deprecated Use a literal {@code 'd'} instead. */ + /** + * @deprecated Use a literal {@code 'd'} instead. + * @removed + */ @Deprecated public static final char DATE = 'd'; - /** @deprecated Use a literal {@code 'E'} instead. */ + /** + * @deprecated Use a literal {@code 'E'} instead. + * @removed + */ @Deprecated public static final char DAY = 'E'; - /** @deprecated Use a literal {@code 'h'} instead. */ + /** + * @deprecated Use a literal {@code 'h'} instead. + * @removed + */ @Deprecated public static final char HOUR = 'h'; @@ -88,31 +106,51 @@ public class DateFormat { * @deprecated Use a literal {@code 'H'} (for compatibility with {@link SimpleDateFormat} * and Unicode) or {@code 'k'} (for compatibility with Android releases up to and including * Jelly Bean MR-1) instead. Note that the two are incompatible. + * + * @removed */ @Deprecated public static final char HOUR_OF_DAY = 'k'; - /** @deprecated Use a literal {@code 'm'} instead. */ + /** + * @deprecated Use a literal {@code 'm'} instead. + * @removed + */ @Deprecated public static final char MINUTE = 'm'; - /** @deprecated Use a literal {@code 'M'} instead. */ + /** + * @deprecated Use a literal {@code 'M'} instead. + * @removed + */ @Deprecated public static final char MONTH = 'M'; - /** @deprecated Use a literal {@code 'L'} instead. */ + /** + * @deprecated Use a literal {@code 'L'} instead. + * @removed + */ @Deprecated public static final char STANDALONE_MONTH = 'L'; - /** @deprecated Use a literal {@code 's'} instead. */ + /** + * @deprecated Use a literal {@code 's'} instead. + * @removed + */ @Deprecated public static final char SECONDS = 's'; - /** @deprecated Use a literal {@code 'z'} instead. */ + /** + * @deprecated Use a literal {@code 'z'} instead. + * @removed + */ @Deprecated public static final char TIME_ZONE = 'z'; - /** @deprecated Use a literal {@code 'y'} instead. */ + /** + * @deprecated Use a literal {@code 'y'} instead. + * @removed + */ @Deprecated public static final char YEAR = 'y'; @@ -306,9 +344,9 @@ public class DateFormat { } /** - * Gets the current date format stored as a char array. The array will contain - * 3 elements ({@link #DATE}, {@link #MONTH}, and {@link #YEAR}) in the order - * specified by the user's format preference. Note that this order is + * Gets the current date format stored as a char array. Returns a 3 element + * array containing the day ({@code 'd'}), month ({@code 'M'}), and year ({@code 'y'})) + * in the order specified by the user's format preference. Note that this order is * only appropriate for all-numeric dates; spelled-out (MEDIUM and LONG) * dates will generally contain other punctuation, spaces, or words, * not just the day, month, and year, and not necessarily in the same