From 2a8d380f404223926e4ebf7f455a71ded13b2ed3 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 2 Jun 2020 11:36:56 +0100 Subject: [PATCH] Clean up the visibility rules for framework modules Switching from java_library to java_sdk_library switched the meaning of the module name from referring to the implementation library to referring to the stubs. This change updates the visibility rules to reflect that new meaning. Visibility rules that were previously set for the java_library have been moved to the impl_library_visibility property and the special //visibility:override value has been prepended to prevent it from inheriting the values from the visibility property. Visibility rules set for the stubs (via stubs_library_visibility) property have been moved to the visibility property. Bug: 155164730 Test: m nothing Exempt-From-Owner-Approval: Build cleanup Change-Id: Icc9bc5a9ef86cf7ba0f15c2b2a4abd596ec9f640 Merged-In: Icc9bc5a9ef86cf7ba0f15c2b2a4abd596ec9f640 (cherry picked from a17cf677b5fe58ddec610ffd92f7b1b378785232) --- Tethering/common/TetheringLib/Android.bp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Tethering/common/TetheringLib/Android.bp b/Tethering/common/TetheringLib/Android.bp index 408725c865..6c05b11258 100644 --- a/Tethering/common/TetheringLib/Android.bp +++ b/Tethering/common/TetheringLib/Android.bp @@ -16,6 +16,16 @@ java_sdk_library { name: "framework-tethering", defaults: ["framework-module-defaults"], + + // Allow access to the stubs from anywhere. + visibility: ["//visibility:public"], + + // Restrict access to implementation library. + impl_library_visibility: [ + "//visibility:override", // Ignore the visibility property. + "//frameworks/base/packages/Tethering:__subpackages__", + ], + srcs: [ ":framework-tethering-srcs", ], @@ -29,8 +39,6 @@ java_sdk_library { installable: true, hostdex: true, // for hiddenapi check - visibility: ["//frameworks/base/packages/Tethering:__subpackages__"], - stubs_library_visibility: ["//visibility:public"], apex_available: ["com.android.tethering"], permitted_packages: ["android.net"], }