Tidy up API build variables

1) Delete unused Docs.mk.

This removes the last reference to non_openjdk_java_files.bp and
openjdk_java_files.bp filegroups from .mk files.
This means that export_to_make_var can be removed in those files.

2) Introduce a filegroup, core_public_api_files, that can be used
from frameworks/base/ rather than "internal" variables defined in
non_openjdk_java_files.bp, openjdk_java_files.bp and conscrypt.

Bug: 126332291
Test: build only
Change-Id: I3c85d17dd7405e65a6be9e60831b1a07e4f08abf
diff --git a/Docs.mk b/Docs.mk
deleted file mode 100644
index d448537..0000000
--- a/Docs.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- mode: makefile -*-
-# List of libcore directories to include in documentation.
-# Shared between libcore and frameworks/base.
-# Exports: libcore_to_document as a list of .java files relative to libcore/.
-
-ifndef libcore_docs_include_once
-
-# List of libcore javadoc source files
-_libcore_files := $(openjdk_javadoc_files) $(non_openjdk_javadoc_files)
-
-_icu_files := \
- $(call find-files-in-subdirs, external/icu, \
-   "*.java", \
-   android_icu4j/src/main/java/android/icu/lang \
-   android_icu4j/src/main/java/android/icu/math \
-   android_icu4j/src/main/java/android/icu/text \
-   android_icu4j/src/main/java/android/icu/util \
-   )
-_icu_files := $(addprefix external/icu/, $(_icu_files))
-
-# List of libcore-related javadoc source files
-#
-# NOTE: Because libcore-related source spans modules (not just libcore!), files names here are
-# returned that are relative to the build root / $(TOPDIR) and not libcore.
-# BUILD_DROIDDOC requires file names that are relative the *current* LOCAL_DIR so users must account
-# for this.
-# libcore_to_document_generated are files in $(TARGET_OUT_COMMON_INTERMEDIATES)
-libcore_to_document := $(_libcore_files) $(_icu_files)
-libcore_to_document_generated := $(_libcore_generated_files)
-
-libcore_docs_include_once := 1
-endif # libcore_docs_include_once
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index 2d26422..e763224 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -56,7 +56,7 @@
     srcs: [":openjdk_java_files"],
 }
 
-// OpenJDK source is not annotated with @hide so we need a separate
+// OpenJDK source is not annotated with @hide so we need this separate
 // filegroup for just the parts that contribute to the API.
 filegroup {
     name: "core_oj_api_files",
@@ -72,7 +72,7 @@
     ],
 }
 
-// Some parts of libart are not annotated with @hide so we need a separate
+// Some parts of libart are not annotated with @hide so we need this separate
 // filegroup for just the parts that contribute to the API.
 filegroup {
     name: "core_libart_api_files",
@@ -82,14 +82,26 @@
     ],
 }
 
+// The set of files for the core library that have been marked up with @hide
+// for the public SDK APIs. Used from frameworks/base/ to indicate the source
+// files for inclusion in the public SDK docs.
+filegroup {
+    name: "core_public_api_files",
+    srcs: [
+        ":core_oj_api_files",
+        ":core_libart_api_files",
+        ":conscrypt_public_api_files",
+    ],
+}
+
 // The set of files for the core library that have been marked up with @hide and
 // API-related annotations. Note that this includes the intra-core and
 // core-platform APIs as well as the public APIs.
 //
-// Some source files in :openjdk_mmodule_extra_files are annotated by applying
-// annotations to the .annotated.java stubs files in ojluni/annotated/mmodules
-// and rather than in the original source. See the comments in
-// openjdk_java_files.bp for more details.
+// Some source files in :core_oj_api_files and :openjdk_mmodule_extra_files are
+// annotated by applying annotations to the .annotated.java stubs files in
+// ojluni/annotated/mmodules and rather than in the original source. See the comments
+// in openjdk_java_files.bp for more details.
 filegroup {
     name: "core_api_files",
     srcs: [
diff --git a/non_openjdk_java_files.bp b/non_openjdk_java_files.bp
index 91434ab..9d65f04 100644
--- a/non_openjdk_java_files.bp
+++ b/non_openjdk_java_files.bp
@@ -1,6 +1,5 @@
 filegroup {
     name: "non_openjdk_javadoc_files",
-    export_to_make_var: "non_openjdk_javadoc_files",
     srcs: [
         "luni/src/main/java/android/system/ErrnoException.java",
         "luni/src/main/java/android/system/GaiException.java",
@@ -295,7 +294,6 @@
 
 filegroup {
     name: "non_openjdk_java_files",
-    export_to_make_var: "non_openjdk_java_files",
     srcs: [
         "luni/src/main/java/java/net/AddressCache.java",
         "luni/src/main/java/libcore/icu/CollationKeyICU.java",
diff --git a/openjdk_java_files.bp b/openjdk_java_files.bp
index e71016e..5c27228 100644
--- a/openjdk_java_files.bp
+++ b/openjdk_java_files.bp
@@ -2,7 +2,6 @@
 // members are hidden using @hide javadoc tags.
 filegroup {
     name: "openjdk_javadoc_files",
-    export_to_make_var: "openjdk_javadoc_files",
     srcs: [
         "ojluni/src/main/java/java/awt/font/NumericShaper.java",
         "ojluni/src/main/java/java/awt/font/TextAttribute.java",
@@ -1359,7 +1358,6 @@
 // any of these classes.
 filegroup {
     name: "openjdk_lambda_stub_files",
-    export_to_make_var: "openjdk_lambda_stub_files",
     srcs: [
         "ojluni/src/lambda/java/java/lang/invoke/LambdaMetafactory.java",
         "ojluni/src/lambda/java/java/lang/invoke/SerializedLambda.java",
@@ -1367,7 +1365,6 @@
 }
 filegroup {
     name: "openjdk_lambda_duplicate_stub_files",
-    export_to_make_var: "openjdk_lambda_duplicate_stub_files",
     srcs: [
         "ojluni/src/lambda/java/java/lang/invoke/CallSite.java",
         "ojluni/src/lambda/java/java/lang/invoke/MethodHandles.java",
@@ -1796,7 +1793,6 @@
 // All classes, whether exposed in any API or not.
 filegroup {
     name: "openjdk_java_files",
-    export_to_make_var: "openjdk_java_files",
     srcs: [
         ":openjdk_javadoc_files",
         ":openjdk_mmodule_extra_files",