From 8d69313c3f8865758c7ed0cb79469aeda9d5d5e6 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Fri, 3 May 2019 14:28:20 +0100 Subject: [PATCH] Remove JapaneseCalendar.CURRENT_ERA from Android public SDK JapaneseCalendar.CURRENT_ERA is final static int, and the developer may mis-use and could have wrong expectation on this API, since 1. New emperor in Japan could result in a new era, but old Android device still provides an outdated "current" era. 2. Developer may expect its value depending on system time. However, given it's a static final int, Android could intiailize the value at boot with an incorrect time, and thus results in incorrect era. Thus, on Android, The value is always hard-coded. Bug: 131893534 Test: make Change-Id: I16ea841975dd8e913409c884123003f842c55bb8 --- api/current.txt | 1 - api/removed.txt | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/api/current.txt b/api/current.txt index 2417d8ef1924e..7842dda0aa148 100755 --- a/api/current.txt +++ b/api/current.txt @@ -20930,7 +20930,6 @@ package android.icu.util { ctor public JapaneseCalendar(int, int, int, int); ctor public JapaneseCalendar(int, int, int); ctor public JapaneseCalendar(int, int, int, int, int, int); - field @Deprecated public static final int CURRENT_ERA; field public static final int HEISEI; field public static final int MEIJI; field public static final int SHOWA; diff --git a/api/removed.txt b/api/removed.txt index 72202ad9712a0..f40b14614323b 100644 --- a/api/removed.txt +++ b/api/removed.txt @@ -275,6 +275,14 @@ package android.hardware { } +package android.icu.util { + + public class JapaneseCalendar extends android.icu.util.GregorianCalendar { + field public static final int CURRENT_ERA; + } + +} + package android.location { public class Location implements android.os.Parcelable {