1// Copyright (C) 2022 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_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19// Encapsulate the contributions made by the com.android.configinfrastructure to the bootclasspath.
20bootclasspath_fragment {
21    name: "com.android.configinfrastructure-bootclasspath-fragment",
22    contents: ["framework-configinfrastructure"],
23    apex_available: ["com.android.configinfrastructure"],
24    hidden_api: {
25
26        // The following packages contain classes from other modules on the
27        // bootclasspath. That means that the hidden API flags for this module
28        // has to explicitly list every single class this module provides in
29        // that package to differentiate them from the classes provided by other
30        // modules. That can include private classes that are not part of the
31        // API.
32        split_packages: [
33            "android.provider",
34        ],
35
36        // The following packages and all their subpackages currently only
37        // contain classes from this bootclasspath_fragment. Listing a package
38        // here won't prevent other bootclasspath modules from adding classes in
39        // any of those packages but it will prevent them from adding those
40        // classes into an API surface, e.g. public, system, etc.. Doing so will
41        // result in a build failure due to inconsistent flags.
42        package_prefixes: [
43            "android.provider.aidl",
44            "android.provider.internal.modules.utils.build",
45        ],
46    },
47    // The bootclasspath_fragments that provide APIs on which this depends.
48    fragments: [
49        // Needed to access core java APIs.
50        {
51            apex: "com.android.art",
52            module: "art-bootclasspath-fragment",
53        },
54    ],
55
56    // Additional stubs libraries that this fragment's contents use which are
57    // not provided by another bootclasspath_fragment.
58    additional_stubs: [
59        // Needed to access platform APIs.
60        "android-non-updatable",
61    ],
62}
63
64// Encapsulate the contributions made by the com.android.configinfrastructure to the systemserverclasspath.
65systemserverclasspath_fragment {
66    name: "com.android.configinfrastructure-systemserverclasspath-fragment",
67    contents: ["service-configinfrastructure"],
68    apex_available: ["com.android.configinfrastructure"],
69}
70
71apex_key {
72    name: "com.android.configinfrastructure.key",
73    public_key: "com.android.configinfrastructure.avbpubkey",
74    private_key: "com.android.configinfrastructure.pem",
75}
76
77android_app_certificate {
78    name: "com.android.configinfrastructure.certificate",
79    certificate: "com.android.configinfrastructure",
80}
81
82apex {
83    name: "com.android.configinfrastructure",
84    bootclasspath_fragments: ["com.android.configinfrastructure-bootclasspath-fragment"],
85    defaults: ["u-launched-apex-module"],
86    systemserverclasspath_fragments: [
87        "com.android.configinfrastructure-systemserverclasspath-fragment",
88    ],
89    manifest: "manifest.json",
90    file_contexts: ":apex.test-file_contexts",
91    prebuilts: [
92        "current_sdkinfo",
93    ],
94    min_sdk_version: "34",
95    key: "com.android.configinfrastructure.key",
96    certificate: ":com.android.configinfrastructure.certificate",
97    apps: [
98        "DeviceConfigServiceResources",
99    ],
100}
101
102sdk {
103    name: "configinfrastructure-sdk",
104    apexes: ["com.android.configinfrastructure"],
105}
106