Pave the way for external mainline module API annotations.

This change prepares for adding mainline mode API annotations
(@CorePlatformApi etc.) supplied in external .annotated.java files so
they are not carried as patches in ojluni source files.

No real annotations are introduced in this change, and it has no
effect on the generated stubs for any of the affected targets (except,
seemingly, a few trivial whitespace changes).

Specifically, this change does the following:

- Adds a placeholder .annotated.java file (to be removed as soon as we
  have any real ones).

- Adds a @libcore.api.Hide annotation we can use as an alternative to
  the @hide javadoc tag.

- Changes the relevant mainline module API droidstubs rules to merge
  in the .annotated.java annotations and to respect the @Hide
  annotation.

- Refactors the openjdk_java_files targets to create a new category of
  source file, those which are annotated for the mainline module APIs
  but are not part of the public API. (The alternative to doing this
  would be to move them into the public category and change all the
  public API droidstubs to merge in the .annotated.java annotations
  and to respect @Hide, which would be significantly more invasive.)

- Changes the relevant mainline module API droidstubs rules use the
  new source categories.

Bug: 115746226
Test: `make core-platform-api-stubs core-intra-stubs core-libart+oj-intra-stubs`
Change-Id: I33e80603686112d3eb5a05debb58f13764b819b6
diff --git a/openjdk_java_files.bp b/openjdk_java_files.bp
index 3307923..c555fdc 100644
--- a/openjdk_java_files.bp
+++ b/openjdk_java_files.bp
@@ -1,3 +1,5 @@
+// Classes which are part of the public API, except where classes and
+// members are hidden using @hide javadoc tags.
 filegroup {
     name: "openjdk_javadoc_files",
     export_to_make_var: "openjdk_javadoc_files",
@@ -1346,8 +1348,8 @@
         "ojluni/src/main/java/javax/sql/StatementEventListener.java",
         "ojluni/src/main/java/sun/reflect/CallerSensitive.java",
     ],
-
 }
+
 // Stubs needed to satisfy javac's dependencies when compiling lambda code. These are
 // not used on Android devices or required by the Jack compiler.
 //
@@ -1366,7 +1368,6 @@
         "ojluni/src/lambda/java/java/lang/invoke/SerializedLambda.java",
     ],
 }
-
 filegroup {
     name: "openjdk_lambda_duplicate_stub_files",
     export_to_make_var: "openjdk_lambda_duplicate_stub_files",
@@ -1380,11 +1381,24 @@
     ],
 }
 
-// NOTE: Files in java/lang/invoke are listed here because they're not being made public
-// until the entire package is available for use.
+// Classes which are exposed in the intra-core or core-platform APIs but not in
+// the public APIs. Unless they are annotated, these classes and all their
+// members will be exposed in all such APIs. To avoid patching the main ojluni
+// sources, these API annotations can be placed in .annotated.java stub files
+// under ojluni/annotations/mmodule. Classes must be hidden using the
+// libcore.api.Hide annotation, and then the class and the members to be exposed
+// must be annotated with libcore.api.CorePlatformApi and/or
+// libcore.api.IntraCoreApi.
 filegroup {
-    name: "openjdk_java_files",
-    export_to_make_var: "openjdk_java_files",
+    name: "openjdk_mmodule_extra_files",
+    path: "ojluni/src/lambda/java",
+    srcs: [
+    ],
+}
+
+// Classes not exposed in any API (either public or mmodule).
+filegroup {
+    name: "openjdk_internal_files",
     path: "ojluni/src/lambda/java",
     srcs: [
         "ojluni/src/main/java/com/sun/net/ssl/internal/ssl/X509ExtendedTrustManager.java",
@@ -1776,7 +1790,18 @@
         "ojluni/src/main/java/sun/util/logging/PlatformLogger.java",
         "ojluni/src/main/java/sun/util/ResourceBundleEnumeration.java",
         "ojluni/src/main/java/sun/util/resources/OpenListResourceBundle.java",
+    ],
+}
+
+// All classes, whether exposed in any API or not.
+filegroup {
+    name: "openjdk_java_files",
+    export_to_make_var: "openjdk_java_files",
+    path: "ojluni/src/lambda/java",
+    srcs: [
         ":openjdk_javadoc_files",
+        ":openjdk_mmodule_extra_files",
+        ":openjdk_internal_files",
         ":openjdk_lambda_stub_files",
     ],
 }