Merge "Restrict visibility of core-icu4j"
diff --git a/android_icu4j/api/legacy_platform/current.txt b/android_icu4j/api/legacy_platform/current.txt
index 31a5337..a81a0c6 100644
--- a/android_icu4j/api/legacy_platform/current.txt
+++ b/android_icu4j/api/legacy_platform/current.txt
@@ -14,7 +14,7 @@
   }
 
   public class DateTimePatternGenerator implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.DateTimePatternGenerator> {
-    method public String getBestPattern(String, boolean);
+    method public String getBestPattern(String, int, boolean);
   }
 
   public final class StringPrep {
diff --git a/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java b/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
index c2ec9e6..3d667d0 100644
--- a/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
+++ b/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
@@ -643,11 +643,21 @@
 
     // BEGIN Android-added: http://b/170233598 Allow duplicate fields
     /**
+     * Return the best pattern matching the input skeleton. It is guaranteed to
+     * have all of the fields in the skeleton.
+     *
+     * @param skeleton The skeleton is a pattern containing only the variable fields.
+     *            For example, "MMMdd" and "mmhh" are skeletons.
+     * @param options MATCH_xxx options for forcing the length of specified fields in
+     *            the returned pattern to match those in the skeleton (when this would
+     *            not happen otherwise). For default behavior, use MATCH_NO_OPTIONS.
+     * @param allowDuplicateFields allows duplicated field in the skeleton
+     * @return Best pattern matching the input skeleton (and options).
      * @hide draft / provisional / internal are hidden on Android
      */
     @libcore.api.CorePlatformApi
-    public String getBestPattern(String skeleton, boolean allowDuplicateFields) {
-        return getBestPattern(skeleton, null, MATCH_NO_OPTIONS, allowDuplicateFields);
+    public String getBestPattern(String skeleton, int options, boolean allowDuplicateFields) {
+        return getBestPattern(skeleton, null, options, allowDuplicateFields);
     }
 
     private String getBestPattern(String skeleton, DateTimeMatcher skipMatcher, int options) {
diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java b/icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java
index 8009792..919a934 100644
--- a/icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java
+++ b/icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java
@@ -646,10 +646,20 @@
 
     // BEGIN Android-added: http://b/170233598 Allow duplicate fields
     /**
+     * Return the best pattern matching the input skeleton. It is guaranteed to
+     * have all of the fields in the skeleton.
+     *
+     * @param skeleton The skeleton is a pattern containing only the variable fields.
+     *            For example, "MMMdd" and "mmhh" are skeletons.
+     * @param options MATCH_xxx options for forcing the length of specified fields in
+     *            the returned pattern to match those in the skeleton (when this would
+     *            not happen otherwise). For default behavior, use MATCH_NO_OPTIONS.
+     * @param allowDuplicateFields allows duplicated field in the skeleton
+     * @return Best pattern matching the input skeleton (and options).
      * @internal
      */
-    public String getBestPattern(String skeleton, boolean allowDuplicateFields) {
-        return getBestPattern(skeleton, null, MATCH_NO_OPTIONS, allowDuplicateFields);
+    public String getBestPattern(String skeleton, int options, boolean allowDuplicateFields) {
+        return getBestPattern(skeleton, null, options, allowDuplicateFields);
     }
 
     private String getBestPattern(String skeleton, DateTimeMatcher skipMatcher, int options) {
diff --git a/tools/srcgen/core-platform-api.txt b/tools/srcgen/core-platform-api.txt
index af8e9c4..0ff685a 100644
--- a/tools/srcgen/core-platform-api.txt
+++ b/tools/srcgen/core-platform-api.txt
@@ -3,7 +3,7 @@
 enumConstant:android.icu.util.Region$RegionType#TERRITORY
 method:android.icu.impl.TimeZoneAdapter#wrap(android.icu.util.TimeZone)
 method:android.icu.text.DateFormatSymbols#getAmpmNarrowStrings()
-method:android.icu.text.DateTimePatternGenerator#getBestPattern(String,boolean)
+method:android.icu.text.DateTimePatternGenerator#getBestPattern(String,int,boolean)
 method:android.icu.text.StringPrep#getInstance(int)
 method:android.icu.text.StringPrep#prepare(String,int)
 method:android.icu.util.BasicTimeZone#getNextTransition(long,boolean)