Tag assorted CorePlatformApi APIs

These were found while investigating targets besides
"framework" needed by targets that are
closely tied to framework. e.g.
framework/core/services, framework/opt/telephony.

Bug: 113148576
Test: build
Change-Id: Ifeb4f78e5e1807a211f674c90e8045f423b2aaed
diff --git a/dalvik/src/main/java/dalvik/annotation/optimization/CriticalNative.java b/dalvik/src/main/java/dalvik/annotation/optimization/CriticalNative.java
index 4564b18..c64aa5f 100644
--- a/dalvik/src/main/java/dalvik/annotation/optimization/CriticalNative.java
+++ b/dalvik/src/main/java/dalvik/annotation/optimization/CriticalNative.java
@@ -93,6 +93,7 @@
  *
  * @hide
  */
+@libcore.api.CorePlatformApi
 @Retention(RetentionPolicy.CLASS)  // Save memory, don't instantiate as an object at runtime.
 @Target(ElementType.METHOD)
 public @interface CriticalNative {}
diff --git a/dalvik/src/main/java/dalvik/annotation/optimization/FastNative.java b/dalvik/src/main/java/dalvik/annotation/optimization/FastNative.java
index 605df4d..a5c0dc5 100644
--- a/dalvik/src/main/java/dalvik/annotation/optimization/FastNative.java
+++ b/dalvik/src/main/java/dalvik/annotation/optimization/FastNative.java
@@ -62,6 +62,7 @@
  *
  * @hide
  */
+@libcore.api.CorePlatformApi
 @Retention(RetentionPolicy.CLASS)  // Save memory, don't instantiate as an object at runtime.
 @Target(ElementType.METHOD)
 public @interface FastNative {}
diff --git a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
index 2ff1814..6697a8c 100644
--- a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
+++ b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
@@ -262,6 +262,7 @@
     /**
      * @hide
      */
+    @libcore.api.CorePlatformApi
     public interface Reporter {
         /**
          * Reports the construction of a BaseDexClassLoader and provides information about the
diff --git a/libart/src/main/java/dalvik/system/VMRuntime.java b/libart/src/main/java/dalvik/system/VMRuntime.java
index 78001fa..35d1197 100644
--- a/libart/src/main/java/dalvik/system/VMRuntime.java
+++ b/libart/src/main/java/dalvik/system/VMRuntime.java
@@ -29,6 +29,7 @@
  *
  * @hide
  */
+@libcore.api.CorePlatformApi
 public final class VMRuntime {
 
     /**
@@ -58,6 +59,7 @@
      * any released version in {@code android.os.Build.VERSION_CODES}.
      * @hide
      */
+    @libcore.api.CorePlatformApi
     public static final int SDK_VERSION_CUR_DEVELOPMENT = 10000;
 
     private static Consumer<String> nonSdkApiUsageConsumer = null;
@@ -76,6 +78,7 @@
      *
      * @return the runtime object
      */
+    @libcore.api.CorePlatformApi
     public static VMRuntime getRuntime() {
         return THE_ONE;
     }
@@ -104,6 +107,7 @@
     /**
      * Returns the name of the shared library providing the VM implementation.
      */
+    @libcore.api.CorePlatformApi
     public native String vmLibrary();
 
     /**
@@ -146,6 +150,7 @@
      * @return the previous ideal heap utilization
      * @throws IllegalArgumentException if newTarget is &lt;= 0.0 or &gt;= 1.0
      */
+    @libcore.api.CorePlatformApi
     public float setTargetHeapUtilization(float newTarget) {
         if (newTarget <= 0.0f || newTarget >= 1.0f) {
             throw new IllegalArgumentException(newTarget +
@@ -253,12 +258,14 @@
      * Tells the VM to enable the JIT compiler. If the VM does not have a JIT
      * implementation, calling this method should have no effect.
      */
+    @libcore.api.CorePlatformApi
     public native void startJitCompilation();
 
     /**
      * Tells the VM to disable the JIT compiler. If the VM does not have a JIT
      * implementation, calling this method should have no effect.
      */
+    @libcore.api.CorePlatformApi
     public native void disableJitCompilation();
 
     /**
@@ -312,6 +319,7 @@
      * Removes any growth limits, allowing the application to allocate
      * up to the maximum heap size.
      */
+    @libcore.api.CorePlatformApi
     public native void clearGrowthLimit();
 
     /**
diff --git a/luni/src/main/java/android/system/OsConstants.java b/luni/src/main/java/android/system/OsConstants.java
index 7ede6a7..2a9b0ea 100644
--- a/luni/src/main/java/android/system/OsConstants.java
+++ b/luni/src/main/java/android/system/OsConstants.java
@@ -531,10 +531,12 @@
     public static final int SO_SNDTIMEO = placeholder();
     public static final int SO_TYPE = placeholder();
     /** @hide */
+    @libcore.api.CorePlatformApi
     public static final int SPLICE_F_MOVE = placeholder();
     /** @hide */
     public static final int SPLICE_F_NONBLOCK = placeholder();
     /** @hide */
+    @libcore.api.CorePlatformApi
     public static final int SPLICE_F_MORE = placeholder();
     public static final int STDERR_FILENO = placeholder();
     public static final int STDIN_FILENO = placeholder();
diff --git a/luni/src/main/java/android/system/PacketSocketAddress.java b/luni/src/main/java/android/system/PacketSocketAddress.java
index 510771c..777ef64 100644
--- a/luni/src/main/java/android/system/PacketSocketAddress.java
+++ b/luni/src/main/java/android/system/PacketSocketAddress.java
@@ -26,6 +26,7 @@
  *
  * @hide
  */
+@libcore.api.CorePlatformApi
 public final class PacketSocketAddress extends SocketAddress {
     /** Protocol. An Ethernet protocol type, e.g., {@code ETH_P_IPV6}. */
     public short sll_protocol;
diff --git a/luni/src/main/java/libcore/icu/ICU.java b/luni/src/main/java/libcore/icu/ICU.java
index 71fe99b..af31110 100644
--- a/luni/src/main/java/libcore/icu/ICU.java
+++ b/luni/src/main/java/libcore/icu/ICU.java
@@ -28,7 +28,9 @@
 
 /**
  * Makes ICU data accessible to Java.
+ * @hide
  */
+@libcore.api.CorePlatformApi
 public final class ICU {
   private static final BasicLruCache<String, String> CACHED_PATTERNS =
       new BasicLruCache<String, String>(8);
@@ -439,6 +441,7 @@
 
   public static native String getISO3Language(String languageTag);
 
+  @libcore.api.CorePlatformApi
   public static Locale addLikelySubtags(Locale locale) {
       return Locale.forLanguageTag(addLikelySubtags(locale.toLanguageTag()).replace('_', '-'));
   }
diff --git a/luni/src/main/java/libcore/io/IoUtils.java b/luni/src/main/java/libcore/io/IoUtils.java
index f4853c1..f235e1a 100644
--- a/luni/src/main/java/libcore/io/IoUtils.java
+++ b/luni/src/main/java/libcore/io/IoUtils.java
@@ -32,6 +32,7 @@
 import static android.system.OsConstants.*;
 
 /** @hide */
+@libcore.api.CorePlatformApi
 @libcore.api.IntraCoreApi
 public final class IoUtils {
     private IoUtils() {
@@ -153,6 +154,7 @@
     /**
      * Closes 'closeable', ignoring any checked exceptions. Does nothing if 'closeable' is null.
      */
+    @libcore.api.CorePlatformApi
     @libcore.api.IntraCoreApi
     public static void closeQuietly(AutoCloseable closeable) {
         if (closeable != null) {
@@ -168,6 +170,7 @@
     /**
      * Closes 'fd', ignoring any exceptions. Does nothing if 'fd' is null or invalid.
      */
+    @libcore.api.CorePlatformApi
     public static void closeQuietly(FileDescriptor fd) {
         try {
             IoUtils.close(fd);
diff --git a/luni/src/main/java/libcore/io/Streams.java b/luni/src/main/java/libcore/io/Streams.java
index 346bba0..74e2d9d 100644
--- a/luni/src/main/java/libcore/io/Streams.java
+++ b/luni/src/main/java/libcore/io/Streams.java
@@ -27,6 +27,8 @@
 import java.io.StringWriter;
 import java.util.concurrent.atomic.AtomicReference;
 
+/** @hide */
+@libcore.api.CorePlatformApi
 public final class Streams {
     private static AtomicReference<byte[]> skipBuffer = new AtomicReference<byte[]>();
 
@@ -177,6 +179,7 @@
      * Copies all of the bytes from {@code in} to {@code out}. Neither stream is closed.
      * Returns the total number of bytes transferred.
      */
+    @libcore.api.CorePlatformApi
     public static int copy(InputStream in, OutputStream out) throws IOException {
         int total = 0;
         byte[] buffer = new byte[8192];
diff --git a/luni/src/main/java/libcore/util/CountryTimeZones.java b/luni/src/main/java/libcore/util/CountryTimeZones.java
index f05bf28..4bf4023 100644
--- a/luni/src/main/java/libcore/util/CountryTimeZones.java
+++ b/luni/src/main/java/libcore/util/CountryTimeZones.java
@@ -28,18 +28,24 @@
 
 /**
  * Information about a country's time zones.
+ * @hide
  */
+@libcore.api.CorePlatformApi
 public final class CountryTimeZones {
 
     /**
      * The result of lookup up a time zone using offset information (and possibly more).
+     * @hide
      */
+    @libcore.api.CorePlatformApi
     public final static class OffsetResult {
 
         /** A zone that matches the supplied criteria. See also {@link #mOneMatch}. */
+        @libcore.api.CorePlatformApi
         public final TimeZone mTimeZone;
 
         /** True if there is one match for the supplied criteria */
+        @libcore.api.CorePlatformApi
         public final boolean mOneMatch;
 
         public OffsetResult(TimeZone timeZone, boolean oneMatch) {
@@ -184,6 +190,7 @@
     /**
      * Returns true if the ISO code for the country is a match for the one specified.
      */
+    @libcore.api.CorePlatformApi
     public boolean isForCountryCode(String countryIso) {
         return this.countryIso.equals(normalizeCountryIso(countryIso));
     }
@@ -211,6 +218,7 @@
      * available or the time zone ID provided to
      * {@link #createValidated(String, String, boolean, List, String)} was not recognized.
      */
+    @libcore.api.CorePlatformApi
     public String getDefaultTimeZoneId() {
         return defaultTimeZoneId;
     }
@@ -289,6 +297,7 @@
     /**
      * Returns true if the country has at least one zone that is the same as UTC at the given time.
      */
+    @libcore.api.CorePlatformApi
     public boolean hasUtcZone(long whenMillis) {
         // If the data tells us the country never uses UTC we don't have to check anything.
         if (!everUsesUtc) {
@@ -309,6 +318,7 @@
      * </em> making the default equivalent to all other zones used by the country <em>at that time
      * </em>.
      */
+    @libcore.api.CorePlatformApi
     public boolean isDefaultOkForCountryTimeZoneDetection(long whenMillis) {
         if (timeZoneMappings.isEmpty()) {
             // Should never happen unless there's been an error loading the data.
@@ -350,6 +360,7 @@
      * @param bias the time zone to prefer, can be null
      * @deprecated Use {@link #lookupByOffsetWithBias(int, Integer, long, TimeZone)} instead
      */
+    @libcore.api.CorePlatformApi
     @Deprecated
     public OffsetResult lookupByOffsetWithBias(int offsetMillis, boolean isDst, long whenMillis,
             TimeZone bias) {
diff --git a/luni/src/main/java/libcore/util/EmptyArray.java b/luni/src/main/java/libcore/util/EmptyArray.java
index eac06f2..93cce01 100644
--- a/luni/src/main/java/libcore/util/EmptyArray.java
+++ b/luni/src/main/java/libcore/util/EmptyArray.java
@@ -16,6 +16,8 @@
 
 package libcore.util;
 
+/** @hide */
+@libcore.api.CorePlatformApi
 public final class EmptyArray {
     private EmptyArray() {}
 
@@ -29,6 +31,7 @@
 
     public static final Class<?>[] CLASS = new Class[0];
     public static final Object[] OBJECT = new Object[0];
+    @libcore.api.CorePlatformApi
     public static final String[] STRING = new String[0];
     public static final Throwable[] THROWABLE = new Throwable[0];
     public static final StackTraceElement[] STACK_TRACE_ELEMENT = new StackTraceElement[0];
diff --git a/luni/src/main/java/libcore/util/HexEncoding.java b/luni/src/main/java/libcore/util/HexEncoding.java
index 5303bb4..aa9c7f0 100644
--- a/luni/src/main/java/libcore/util/HexEncoding.java
+++ b/luni/src/main/java/libcore/util/HexEncoding.java
@@ -18,7 +18,9 @@
 
 /**
  * Hexadecimal encoding where each byte is represented by two hexadecimal digits.
+ * @hide
  */
+@libcore.api.CorePlatformApi
 public class HexEncoding {
 
     /** Hidden constructor to prevent instantiation. */
@@ -29,6 +31,7 @@
     /**
      * Encodes the provided data as a sequence of hexadecimal characters.
      */
+    @libcore.api.CorePlatformApi
     public static char[] encode(byte[] data) {
         return encode(data, 0, data.length);
     }
@@ -61,6 +64,7 @@
      *
      * Throws an {@code IllegalArgumentException} if the input is malformed.
      */
+    @libcore.api.CorePlatformApi
     public static byte[] decode(String encoded) throws IllegalArgumentException {
         return decode(encoded.toCharArray());
     }
@@ -82,6 +86,7 @@
      *
      * Throws an {@code IllegalArgumentException} if the input is malformed.
      */
+    @libcore.api.CorePlatformApi
     public static byte[] decode(char[] encoded) throws IllegalArgumentException {
         return decode(encoded, false);
     }
diff --git a/luni/src/main/java/libcore/util/NativeAllocationRegistry.java b/luni/src/main/java/libcore/util/NativeAllocationRegistry.java
index 57caa05..0cef039 100644
--- a/luni/src/main/java/libcore/util/NativeAllocationRegistry.java
+++ b/luni/src/main/java/libcore/util/NativeAllocationRegistry.java
@@ -38,6 +38,7 @@
  * used to register any number of native allocations of that kind.
  * @hide
  */
+@libcore.api.CorePlatformApi
 public class NativeAllocationRegistry {
 
     private final ClassLoader classLoader;
diff --git a/luni/src/main/java/libcore/util/TimeZoneFinder.java b/luni/src/main/java/libcore/util/TimeZoneFinder.java
index 7c682d0..bed0f24 100644
--- a/luni/src/main/java/libcore/util/TimeZoneFinder.java
+++ b/luni/src/main/java/libcore/util/TimeZoneFinder.java
@@ -42,7 +42,9 @@
 
 /**
  * A class that can find matching time zones by loading data from the tzlookup.xml file.
+ * @hide
  */
+@libcore.api.CorePlatformApi
 public final class TimeZoneFinder {
 
     private static final String TZLOOKUP_FILE_NAME = "tzlookup.xml";
@@ -89,6 +91,7 @@
      * file when there are several to choose from. This method never returns {@code null}. No
      * in-depth validation is performed on the file content, see {@link #validate()}.
      */
+    @libcore.api.CorePlatformApi
     public static TimeZoneFinder getInstance() {
         synchronized(TimeZoneFinder.class) {
             if (instance == null) {
@@ -130,6 +133,7 @@
      * exist or is not readable. This method never returns {@code null}. No in-depth validation is
      * performed on the file content, see {@link #validate()}.
      */
+    @libcore.api.CorePlatformApi
     public static TimeZoneFinder createInstance(String path) throws IOException {
         ReaderSupplier xmlSupplier = ReaderSupplier.forFile(path, StandardCharsets.UTF_8);
         return new TimeZoneFinder(xmlSupplier);
@@ -144,6 +148,7 @@
     /**
      * Parses the data file, throws an exception if it is invalid or cannot be read.
      */
+    @libcore.api.CorePlatformApi
     public void validate() throws IOException {
         try {
             processXml(new TimeZonesValidator());
@@ -213,6 +218,7 @@
      * <p>If the country code is not recognized or there is an error during lookup this can return
      * null.
      */
+    @libcore.api.CorePlatformApi
     public String lookupDefaultTimeZoneIdByCountry(String countryIso) {
         CountryTimeZones countryTimeZones = lookupCountryTimeZones(countryIso);
         return countryTimeZones == null ? null : countryTimeZones.getDefaultTimeZoneId();
@@ -249,6 +255,7 @@
      * Caching is handled as needed. If the country code is not recognized or there is an error
      * during lookup this method can return null.
      */
+    @libcore.api.CorePlatformApi
     public CountryTimeZones lookupCountryTimeZones(String countryIso) {
         synchronized (this) {
             if (lastCountryTimeZones != null && lastCountryTimeZones.isForCountryCode(countryIso)) {
diff --git a/luni/src/main/java/libcore/util/ZoneInfoDB.java b/luni/src/main/java/libcore/util/ZoneInfoDB.java
index 9e58070..2b55c83 100644
--- a/luni/src/main/java/libcore/util/ZoneInfoDB.java
+++ b/luni/src/main/java/libcore/util/ZoneInfoDB.java
@@ -37,6 +37,7 @@
  *
  * @hide - used to implement TimeZone
  */
+@libcore.api.CorePlatformApi
 public final class ZoneInfoDB {
 
   // VisibleForTesting
@@ -45,6 +46,8 @@
   private static final TzData DATA =
           TzData.loadTzDataWithFallback(TimeZoneDataFiles.getTimeZoneFilePaths(TZDATA_FILE));
 
+  /** @hide */
+  @libcore.api.CorePlatformApi
   public static class TzData implements AutoCloseable {
 
     // The database reserves 40 bytes for each id.
@@ -128,6 +131,7 @@
      * Loads the data at the specified path and returns the {@link TzData} object if it is valid,
      * otherwise {@code null}.
      */
+    @libcore.api.CorePlatformApi
     public static TzData loadTzData(String path) {
       TzData tzData = new TzData();
       if (tzData.loadData(path)) {
@@ -290,6 +294,7 @@
       }
     }
 
+    @libcore.api.CorePlatformApi
     public void validate() throws IOException {
       checkNotClosed();
       // Validate the data in the tzdata file by loading each and every zone.
@@ -405,6 +410,7 @@
      * file. This method just reads the header of the file, and so is less expensive than mapping
      * the whole file into memory (and provides no guarantees about validity).
      */
+    @libcore.api.CorePlatformApi
     public static String getRulesVersion(File tzDataFile) throws IOException {
       try (FileInputStream is = new FileInputStream(tzDataFile)) {
 
diff --git a/non_openjdk_java_files.bp b/non_openjdk_java_files.bp
index 918c3e9..e4b0742 100644
--- a/non_openjdk_java_files.bp
+++ b/non_openjdk_java_files.bp
@@ -159,11 +159,19 @@
         "luni/src/main/java/libcore/api/CorePlatformApi.java",
         "luni/src/main/java/libcore/api/Hide.java",
         "luni/src/main/java/libcore/api/IntraCoreApi.java",
+        "luni/src/main/java/libcore/icu/ICU.java",
         "luni/src/main/java/libcore/io/IoUtils.java",
         "luni/src/main/java/libcore/io/Libcore.java",
         "luni/src/main/java/libcore/io/Os.java",
+        "luni/src/main/java/libcore/io/Streams.java",
         "luni/src/main/java/libcore/mmodule/libart/DemoLibartClass.java",
         "luni/src/main/java/libcore/net/NetworkSecurityPolicy.java",
+        "luni/src/main/java/libcore/util/CountryTimeZones.java",
+        "luni/src/main/java/libcore/util/EmptyArray.java",
+        "luni/src/main/java/libcore/util/HexEncoding.java",
+        "luni/src/main/java/libcore/util/NativeAllocationRegistry.java",
+        "luni/src/main/java/libcore/util/TimeZoneFinder.java",
+        "luni/src/main/java/libcore/util/ZoneInfoDB.java",
         "json/src/main/java/org/json/JSON.java",
         "json/src/main/java/org/json/JSONArray.java",
         "json/src/main/java/org/json/JSONException.java",
@@ -263,7 +271,6 @@
         "luni/src/main/java/libcore/icu/DateIntervalFormat.java",
         "luni/src/main/java/libcore/icu/DateTimeFormat.java",
         "luni/src/main/java/libcore/icu/DateUtilsBridge.java",
-        "luni/src/main/java/libcore/icu/ICU.java",
         "luni/src/main/java/libcore/icu/LocaleData.java",
         "luni/src/main/java/libcore/icu/NativeConverter.java",
         "luni/src/main/java/libcore/icu/RelativeDateTimeFormatter.java",
@@ -283,7 +290,6 @@
         "luni/src/main/java/libcore/io/MemoryMappedFile.java",
         "luni/src/main/java/libcore/io/NioBufferIterator.java",
         "luni/src/main/java/libcore/io/SizeOf.java",
-        "luni/src/main/java/libcore/io/Streams.java",
         "luni/src/main/java/libcore/math/MathUtils.java",
         "luni/src/main/java/libcore/net/MimeUtils.java",
         "luni/src/main/java/libcore/net/event/NetworkEventDispatcher.java",
@@ -304,24 +310,17 @@
         "luni/src/main/java/libcore/reflect/WildcardTypeImpl.java",
         "luni/src/main/java/libcore/util/ArrayUtils.java",
         "luni/src/main/java/libcore/util/CharsetUtils.java",
-        "luni/src/main/java/libcore/util/EmptyArray.java",
         "luni/src/main/java/libcore/util/BasicLruCache.java",
         "luni/src/main/java/libcore/util/CollectionUtils.java",
-        "luni/src/main/java/libcore/util/CountryTimeZones.java",
         "luni/src/main/java/libcore/util/CountryZonesFinder.java",
-        "luni/src/main/java/libcore/util/EmptyArray.java",
-        "luni/src/main/java/libcore/util/HexEncoding.java",
-        "luni/src/main/java/libcore/util/NativeAllocationRegistry.java",
         "luni/src/main/java/libcore/util/NonNull.java",
         "luni/src/main/java/libcore/util/Nullable.java",
         "luni/src/main/java/libcore/util/NullFromTypeParam.java",
         "luni/src/main/java/libcore/util/Objects.java",
         "luni/src/main/java/libcore/util/SneakyThrow.java",
         "luni/src/main/java/libcore/util/TimeZoneDataFiles.java",
-        "luni/src/main/java/libcore/util/TimeZoneFinder.java",
         "luni/src/main/java/libcore/util/XmlObjectFactory.java",
         "luni/src/main/java/libcore/util/ZoneInfo.java",
-        "luni/src/main/java/libcore/util/ZoneInfoDB.java",
         "dalvik/src/main/java/org/apache/harmony/dalvik/NativeTestTarget.java",
         "dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/Chunk.java",
         "dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/ChunkHandler.java",
diff --git a/ojluni/src/main/java/java/lang/Class.java b/ojluni/src/main/java/java/lang/Class.java
index f792248..512b965 100644
--- a/ojluni/src/main/java/java/lang/Class.java
+++ b/ojluni/src/main/java/java/lang/Class.java
@@ -908,6 +908,7 @@
      *
      * @hide
      */
+    @libcore.api.CorePlatformApi
     public String getPackageName$() {
         String name = getName();
         int last = name.lastIndexOf('.');
diff --git a/ojluni/src/main/java/java/net/InetAddress.java b/ojluni/src/main/java/java/net/InetAddress.java
index e58f307..52533af 100644
--- a/ojluni/src/main/java/java/net/InetAddress.java
+++ b/ojluni/src/main/java/java/net/InetAddress.java
@@ -1614,6 +1614,7 @@
      *
      * @hide used by frameworks/base to ensure that a getAllByName won't cause a DNS lookup.
      */
+    @libcore.api.CorePlatformApi
     @libcore.api.IntraCoreApi
     public static boolean isNumeric(String address) {
         InetAddress inetAddress = parseNumericAddressNoThrow(address);
@@ -1654,6 +1655,7 @@
      * @hide used by frameworks/base's NetworkUtils.numericToInetAddress
      * @throws IllegalArgumentException if {@code numericAddress} is not a numeric address
      */
+    @libcore.api.CorePlatformApi
     public static InetAddress parseNumericAddress(String numericAddress) {
         if (numericAddress == null || numericAddress.isEmpty()) {
             return Inet6Address.LOOPBACK;