Apply annotations to stubs and stop exporting droiddoc dirs

Previously, the ojluni-annotated-sdk-stubs droiddoc_exported_dir
blueprint module was exported to frameworks/base so that it could merge
the annotations from those directories into the public API (stubs, docs
and signature files).

This change applies the annotations to the stubs that libcore generates
which are used by frameworks/base to generate the public API stubs so
frameworks/base no longer has to do that work and the sources that
provide those stubs are not required.

Bug: 142113521
Test: m checkbuild
      made sure that this change does not affect offline-sdk-docs
Change-Id: Iaa00f1041e44a5229f9ffa20a155a051538bf8a0
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index f225485..8429ca6 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -710,9 +710,6 @@
 // available to metalava. Used for nullability annotations in OpenJDK source.
 droiddoc_exported_dir {
     name: "ojluni-annotated-sdk-stubs",
-    visibility: [
-        "//frameworks/base",
-    ],
     path: "ojluni/annotations/sdk",
 }
 
@@ -818,7 +815,14 @@
     create_doc_stubs: true,
 
     // Emit nullability annotations from the source to the stub files.
-    args: "--include-annotations",
+    annotations_enabled: true,
+
+    merge_annotations_dirs: [
+        // TODO(http://b/111116803): Remove once annotations can be supplied in
+        // the ojluni-annotated-sdk-stubs files.
+        "metalava-manual",
+        "ojluni-annotated-sdk-stubs",
+    ],
 }
 
 // A stubs target containing the parts of the public SDK API provided by the ART module.
@@ -928,6 +932,8 @@
         "--validate-nullability-from-merged-stubs ",
     merge_inclusion_annotations_dirs: ["ojluni-annotated-mmodule-stubs"],
     merge_annotations_dirs: [
+        // TODO(http://b/111116803): Remove once annotations can be supplied in
+        // the ojluni-annotated-nullability-stubs files.
         "metalava-manual",
         // N.B. Stubs in this filegroup will be validated:
         "ojluni-annotated-nullability-stubs",