Restrict visibility into the sdkext package
Only the stubs should be visible to the outside world. However,
the sources also need to be exposed for now.
Bug: 137191822
Test: m
Change-Id: Id051cc928c2c5050a6df6470e9ee221f178fd835
diff --git a/apex/sdkext/Android.bp b/apex/sdkext/Android.bp
index 6b52481..b9071f8 100644
--- a/apex/sdkext/Android.bp
+++ b/apex/sdkext/Android.bp
@@ -12,6 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+package {
+ default_visibility: [":__subpackages__"],
+}
+
apex {
name: "com.android.sdkext",
manifest: "manifest.json",
diff --git a/apex/sdkext/framework/Android.bp b/apex/sdkext/framework/Android.bp
index 3a71c58..a50dc3d 100644
--- a/apex/sdkext/framework/Android.bp
+++ b/apex/sdkext/framework/Android.bp
@@ -12,12 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+package {
+ default_visibility: [ ":__pkg__" ]
+}
+
filegroup {
name: "framework-sdkext-sources",
srcs: [
"java/**/*.java",
],
path: "java",
+ visibility: [ "//frameworks/base:__pkg__" ] // For the "global" stubs.
}
java_library {
@@ -27,6 +32,7 @@
libs: [ "framework-annotations-lib" ],
permitted_packages: [ "android.os.ext" ],
installable: true,
+ visibility: [ "//frameworks/base/apex/sdkext:__pkg__" ],
}
droidstubs {
@@ -58,4 +64,8 @@
name: "framework-sdkext-stubs-systemapi",
srcs: [":framework-sdkext-droidstubs-systemapi"],
sdk_version: "system_current",
+ visibility: [
+ "//frameworks/base:__pkg__", // Framework
+ "//frameworks/base/apex/sdkext:__pkg__", // sdkext SDK
+ ]
}