Improve consistency of stubs for framework targets

Group all the module stubs together and use them consistently
where needed.

Bug: 151092414
Test: m
Change-Id: I0ddeb0c1a8764ac64980395eec8d5703ea4eea7e
Merged-In: I0ddeb0c1a8764ac64980395eec8d5703ea4eea7e
diff --git a/Android.bp b/Android.bp
index 27deb48..2bc4fb4 100644
--- a/Android.bp
+++ b/Android.bp
@@ -294,6 +294,17 @@
     ]
 }
 
+java_library {
+    name: "framework-updatable-stubs-module_libs_api",
+    static_libs: [
+        "framework-sdkextensions-stubs-module_libs_api",
+        "framework-tethering-stubs-module_libs_api",
+        "updatable_media_stubs",
+    ],
+    sdk_version: "module_current",
+    visibility: [":__pkg__"],
+}
+
 filegroup {
     name: "framework-all-sources",
     srcs: [
@@ -324,9 +335,11 @@
             "rs/java",
             "sax/java",
             "telecomm/java",
-            "telephony/java",
             "wifi/java",
             "wifi/aidl-export",
+
+            // TODO(b/147699819): remove this
+            "telephony/java",
         ],
     },
 }
@@ -396,7 +409,7 @@
         "app-compat-annotations",
         "ext",
         "unsupportedappusage",
-        "updatable_media_stubs",
+        "framework-updatable-stubs-module_libs_api",
     ],
 
     jarjar_rules: ":framework-jarjar-rules",
@@ -455,9 +468,6 @@
     name: "framework-minus-apex",
     defaults: ["framework-defaults"],
     srcs: [":framework-non-updatable-sources"],
-    libs: [
-        "framework-tethering-stubs-module_libs_api",
-    ],
     installable: true,
     javac_shard_size: 150,
     required: [
@@ -494,9 +504,7 @@
     installable: false, // this lib is a build-only library
     static_libs: [
         "framework-minus-apex",
-        "updatable_media_stubs",
-        "framework-sdkextensions-stubs-systemapi",
-        "framework-tethering-stubs-module_libs_api",
+        "framework-updatable-stubs-module_libs_api",
     ],
     sdk_version: "core_platform",
     apex_available: ["//apex_available:platform"],