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.internal.configinfra",
44            "android.provider.configinfra.internal.protobuf",
45            "android.provider.aidl",
46            "android.provider.flags",
47            "android.provider.internal.aconfig.storage",
48            "android.provider.internal.modules.utils.build",
49
50            "android.os.flagging",
51            "android.provider.x.android.provider.flags",
52        ],
53    },
54    // The bootclasspath_fragments that provide APIs on which this depends.
55    fragments: [
56        // Needed to access core java APIs.
57        {
58            apex: "com.android.art",
59            module: "art-bootclasspath-fragment",
60        },
61    ],
62
63    // Additional stubs libraries that this fragment's contents use which are
64    // not provided by another bootclasspath_fragment.
65    additional_stubs: [
66        // Needed to access platform APIs.
67        "android-non-updatable",
68    ],
69}
70
71// Encapsulate the contributions made by the com.android.configinfrastructure to the systemserverclasspath.
72systemserverclasspath_fragment {
73    name: "com.android.configinfrastructure-systemserverclasspath-fragment",
74    contents: ["service-configinfrastructure"],
75    apex_available: ["com.android.configinfrastructure"],
76}
77
78apex_key {
79    name: "com.android.configinfrastructure.key",
80    public_key: "com.android.configinfrastructure.avbpubkey",
81    private_key: "com.android.configinfrastructure.pem",
82}
83
84android_app_certificate {
85    name: "com.android.configinfrastructure.certificate",
86    certificate: "com.android.configinfrastructure",
87}
88
89prebuilt_etc {
90    name: "com.android.configinfrastrcture.init.rc",
91    src: "configinfrastructure.rc",
92    installable: false,
93}
94
95apex {
96    name: "com.android.configinfrastructure",
97    bootclasspath_fragments: ["com.android.configinfrastructure-bootclasspath-fragment"],
98    defaults: ["u-launched-apex-module"],
99    systemserverclasspath_fragments: [
100        "com.android.configinfrastructure-systemserverclasspath-fragment",
101    ],
102    manifest: "manifest.json",
103    file_contexts: ":com.android.configinfrastructure-file_contexts",
104    binaries: [
105        "aconfigd-mainline",
106    ],
107    prebuilts: [
108        "com.android.configinfrastrcture.init.rc",
109        "current_sdkinfo",
110    ],
111    min_sdk_version: "34",
112    key: "com.android.configinfrastructure.key",
113    certificate: ":com.android.configinfrastructure.certificate",
114    apps: [
115        "DeviceConfigServiceResources",
116    ],
117}
118
119sdk {
120    name: "configinfrastructure-sdk",
121    apexes: ["com.android.configinfrastructure"],
122}
123