diff options
author | Nikita Iashchenko <nikitai@google.com> | 2021-04-12 18:20:41 +0000 |
---|---|---|
committer | Nikita Iashchenko <nikitai@google.com> | 2021-04-20 17:04:06 +0000 |
commit | c3cec117b311248062b0b506431f082a2c17b07a (patch) | |
tree | 28018a805d533807a6eb1d66c161342a0101b331 | |
parent | 4fc8bf92275c80433f4dd851cba8d8423e093ac8 (diff) | |
download | libcore-c3cec117b311248062b0b506431f082a2c17b07a.tar.gz |
Mark stable and document java.text.DateFormat
Bug: 154796679
Test: m update-api
Change-Id: I268152a73a98fc59ea392430c341f789db9702ef
3 files changed, 20 insertions, 4 deletions
diff --git a/mmodules/core_platform_api/api/stable_platform/current.txt b/mmodules/core_platform_api/api/stable_platform/current.txt index 07164af03c9..1b4960fe18c 100644 --- a/mmodules/core_platform_api/api/stable_platform/current.txt +++ b/mmodules/core_platform_api/api/stable_platform/current.txt @@ -410,6 +410,14 @@ package java.security { } +package java.text { + + public abstract class DateFormat extends java.text.Format { + method public static final void set24HourTimePref(Boolean); + } + +} + package java.util.concurrent { public class CompletableFuture<T> implements java.util.concurrent.CompletionStage<T> java.util.concurrent.Future<T> { diff --git a/ojluni/annotations/mmodule/java/text/DateFormat.annotated.java b/ojluni/annotations/mmodule/java/text/DateFormat.annotated.java index 5a28d02c787..6456c83fd9d 100644 --- a/ojluni/annotations/mmodule/java/text/DateFormat.annotated.java +++ b/ojluni/annotations/mmodule/java/text/DateFormat.annotated.java @@ -83,7 +83,7 @@ public static final java.text.DateFormat getDateTimeInstance(int dateStyle, int public static final java.text.DateFormat getInstance() { throw new RuntimeException("Stub!"); } -@libcore.api.CorePlatformApi +@libcore.api.CorePlatformApi(status = libcore.api.CorePlatformApi.Status.STABLE) public static final void set24HourTimePref(java.lang.Boolean is24Hour) { throw new RuntimeException("Stub!"); } public static java.util.Locale[] getAvailableLocales() { throw new RuntimeException("Stub!"); } diff --git a/ojluni/src/main/java/java/text/DateFormat.java b/ojluni/src/main/java/java/text/DateFormat.java index d7d5081b541..8622c2f9522 100644 --- a/ojluni/src/main/java/java/text/DateFormat.java +++ b/ojluni/src/main/java/java/text/DateFormat.java @@ -600,13 +600,21 @@ public abstract class DateFormat extends Format { */ public static Boolean is24Hour; + // BEGIN Android-changed: Improve javadoc for stable SystemApi. /** - * Override the time formatting behavior for SHORT and MEDIUM time formats. - * {@code null}: use Locale default. {@code true}: force 24-hour format. - * {@code false} force 12-hour format. + * Override the time formatting behavior for {@link #SHORT} and {@link #MEDIUM} time formats. + * Accepts one of the following: + * <ul> + * <li>{@code null}: use Locale default/li> + * <li>{@code true}: force 24-hour format</li> + * <li>{@code false} force 12-hour format</li> + * </ul> + * + * @param is24Hour whether to use 24-hour format or not. {@code null} uses locale default. * * @hide for internal use only. */ + // END Android-changed: Improve javadoc for stable SystemApi. public static final void set24HourTimePref(Boolean is24Hour) { DateFormat.is24Hour = is24Hour; } |