Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dde22307 authored by Paul Duffin's avatar Paul Duffin
Browse files

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
parent 85215ae5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -105,7 +105,14 @@ java_sdk_library {
        "framework_media_annotation",
    ],

    visibility: ["//frameworks/av/apex:__subpackages__"],
    // 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/av/apex:__subpackages__",
    ],
}


+10 −4
Original line number Diff line number Diff line
@@ -24,6 +24,16 @@ filegroup {
java_sdk_library {
    name: "framework-permission",
    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/apex/permission:__subpackages__",
    ],

    srcs: [
        ":framework-permission-sources",
    ],
@@ -43,8 +53,4 @@ java_sdk_library {
    ],
    hostdex: true,
    installable: true,
    visibility: [
        "//frameworks/base/apex/permission:__subpackages__",
    ],
    stubs_library_visibility: ["//visibility:public"],
}
+9 −4
Original line number Diff line number Diff line
@@ -75,15 +75,20 @@ java_sdk_library {
    ],

    hostdex: true, // for hiddenapi check

    visibility: [
        "//frameworks/base/apex/statsd:__subpackages__",
    ],
    stubs_library_visibility: [
        "//frameworks/base", // Framework
        "//frameworks/base/apex/statsd", // statsd apex
        "//frameworks/base/apex/statsd:__subpackages__", // statsd apex
        "//frameworks/opt/net/wifi/service", // wifi service
        "//packages/providers/MediaProvider", // MediaProvider apk
    ],

    // Restrict access to implementation library.
    impl_library_visibility: [
        "//visibility:override", // Ignore the visibility property.
        "//frameworks/base/apex/statsd:__subpackages__", // statsd apex
    ],

    apex_available: [
        "com.android.os.statsd",
        "test_com.android.os.statsd",
+10 −2
Original line number Diff line number Diff line
@@ -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"],
}
+8 −2
Original line number Diff line number Diff line
@@ -123,10 +123,16 @@ java_sdk_library {
        enabled: false
    },
    hostdex: true, // for hiddenapi check
    visibility: [

    // 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/opt/net/wifi/service:__subpackages__",
    ] + test_access_hidden_api_whitelist,
    stubs_library_visibility: ["//visibility:public"],

    apex_available: [
        "com.android.wifi",
        "test_com.android.wifi",