1// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_team: "trendy_team_android_permissions",
17    default_applicable_licenses: ["Android-Apache-2.0"],
18    default_visibility: [":__subpackages__"],
19}
20
21apex {
22    name: "com.android.permission",
23    defaults: ["com.android.permission-defaults"],
24    manifest: "apex_manifest.json",
25    compat_configs: [
26        "framework-permission-s-compat-config",
27    ],
28    visibility: ["//packages/modules/common/build"],
29}
30
31apex_defaults {
32    name: "com.android.permission-defaults",
33    defaults: ["r-launched-apex-module"],
34    bootclasspath_fragments: ["com.android.permission-bootclasspath-fragment"],
35    systemserverclasspath_fragments: ["com.android.permission-systemserverclasspath-fragment"],
36    prebuilts: [
37        "current_sdkinfo",
38    ],
39    key: "com.android.permission.key",
40    certificate: ":com.android.permission.certificate",
41    apps: [
42        "PermissionController",
43        "SafetyCenterResources",
44    ],
45    // Indicates that pre-installed version of this apex can be compressed.
46    // Whether it actually will be compressed is controlled on per-device basis.
47    compressible: true,
48}
49
50apex_key {
51    name: "com.android.permission.key",
52    public_key: "com.android.permission.avbpubkey",
53    private_key: "com.android.permission.pem",
54}
55
56android_app_certificate {
57    name: "com.android.permission.certificate",
58    certificate: "com.android.permission",
59}
60
61sdk {
62    name: "permission-module-sdk",
63    apexes: [
64        // Adds exportable dependencies of the APEX to the sdk,
65        // e.g. *classpath_fragments.
66        "com.android.permission",
67    ],
68}
69
70// Encapsulate the contributions made by the com.android.permission to the bootclasspath.
71bootclasspath_fragment {
72    name: "com.android.permission-bootclasspath-fragment",
73    contents: [
74        "framework-permission",
75        "framework-permission-s",
76    ],
77    apex_available: ["com.android.permission"],
78
79    // The bootclasspath_fragments that provide APIs on which this depends.
80    fragments: [
81        {
82            apex: "com.android.art",
83            module: "art-bootclasspath-fragment",
84        },
85    ],
86
87    // Additional stubs libraries that this fragment's contents use which are
88    // not provided by another bootclasspath_fragment.
89    additional_stubs: [
90        "android-non-updatable",
91    ],
92
93    hidden_api: {
94        // The following packages contain classes from other modules on the
95        // bootclasspath. That means that the hidden API flags for this module
96        // has to explicitly list every single class this module provides in
97        // that package to differentiate them from the classes provided by other
98        // modules. That can include private classes that are not part of the
99        // API.
100        split_packages: [
101            "android.permission",
102        ],
103
104        // The following packages and all their subpackages currently only
105        // contain classes from this bootclasspath_fragment. Listing a package
106        // here won't prevent other bootclasspath modules from adding classes in
107        // any of those packages but it will prevent them from adding those
108        // classes into an API surface, e.g. public, system, etc.. Doing so will
109        // result in a build failure due to inconsistent flags.
110        package_prefixes: [
111            "android.app.role",
112            "android.app.ecm",
113            "android.permission.jarjar",
114            "android.safetycenter",
115            "android.safetylabel",
116        ],
117    },
118}
119
120// Encapsulate the contributions made by the com.android.permission to the systemserverclasspath.
121systemserverclasspath_fragment {
122    name: "com.android.permission-systemserverclasspath-fragment",
123    contents: ["service-permission"],
124    apex_available: ["com.android.permission"],
125}
126