• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2023 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_fwk_nfc",
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20apex_key {
21    name: "com.android.nfcservices.key",
22    public_key: "com.android.nfcservices.avbpubkey",
23    private_key: "com.android.nfcservices.pem",
24}
25
26android_app_certificate {
27    name: "com.android.nfcservices.certificate",
28    certificate: "com.android.nfcservices",
29}
30
31soong_config_module_type {
32    name: "custom_apex",
33    module_type: "apex",
34    config_namespace: "bootclasspath",
35    bool_variables: [
36        "nfc_apex_bootclasspath_fragment",
37    ],
38    properties: [
39        "bootclasspath_fragments",
40    ],
41}
42
43custom_apex {
44    name: "com.android.nfcservices",
45    manifest: "manifest.json",
46    apps: ["NfcNciApex"],
47    defaults: ["b-launched-apex-module"],
48    multilib: {
49        first: {
50            // Extractor process runs only with the primary ABI.
51            jni_libs: [
52                "libnfc_nci_jni",
53            ],
54        },
55    },
56    soong_config_variables: {
57        nfc_apex_bootclasspath_fragment: {
58            bootclasspath_fragments: ["com.android.nfcservices-bootclasspath-fragment"],
59        },
60    },
61    // For non-mainline builds
62    required: [
63        // Provide a default libnfc-nci.conf in /system/etc for devices that
64        // does not ship one in /product
65        "libnfc-nci.conf-default",
66    ],
67    // For mainline builds
68    prebuilts: [
69        // Provide a default libnfc-nci.conf in /system/etc for devices that
70        // does not ship one in /product
71        "libnfc-nci.conf-default",
72    ],
73    file_contexts: ":com.android.nfcservices-file_contexts",
74    key: "com.android.nfcservices.key",
75    certificate: ":com.android.nfcservices.certificate",
76    visibility: [
77        "//build/make/target:__subpackages__",
78        "//vendor:__subpackages__",
79    ],
80}
81
82sdk {
83    name: "nfcservices-module-sdk",
84    apexes: [
85        // Adds exportable dependencies of the APEX to the sdk,
86        // e.g. *classpath_fragments.
87        "com.android.nfcservices",
88    ],
89}
90
91soong_config_module_type {
92    name: "custom_bootclasspath_fragment",
93    module_type: "bootclasspath_fragment",
94    config_namespace: "bootclasspath",
95    bool_variables: [
96        "nfc_apex_bootclasspath_fragment",
97    ],
98    properties: [
99        "enabled",
100    ],
101}
102
103// Encapsulate the contributions made by the com.android.nfc to the bootclasspath.
104custom_bootclasspath_fragment {
105    name: "com.android.nfcservices-bootclasspath-fragment",
106    contents: ["framework-nfc"],
107    apex_available: ["com.android.nfcservices"],
108    // This is disabled for now since the build system does not allow for adding a bootclasspath
109    // fragment and conditionally adding it to PRODUCT_APEX_BOOT_JARS.
110    // When `RELEASE_PACKAGE_NFC_STACK` is set to `com.android.nfcservices`, this needs to be
111    // set to true.
112    enabled: false,
113    soong_config_variables: {
114        nfc_apex_bootclasspath_fragment: {
115            enabled: true,
116        },
117    },
118
119    // The bootclasspath_fragments that provide APIs on which this depends.
120    fragments: [
121        // Needed to access core java APIs.
122        {
123            apex: "com.android.art",
124            module: "art-bootclasspath-fragment",
125        },
126    ],
127
128    // Additional stubs libraries that this fragment's contents use which are
129    // not provided by another bootclasspath_fragment.
130    additional_stubs: [
131        // Needed to access platform APIs.
132        "android-non-updatable",
133    ],
134    hidden_api: {
135        // Additional hidden API flag files to override the defaults. This must only be
136        // modified by the Soong or platform compat team.
137        max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o.txt"],
138        max_target_r_low_priority: ["hiddenapi/hiddenapi-max-target-r-loprio.txt"],
139
140        // The following packages contain classes from other modules on the
141        // bootclasspath. That means that the hidden API flags for this module
142        // has to explicitly list every single class this module provides in
143        // that package to differentiate them from the classes provided by other
144        // modules. That can include private classes that are not part of the
145        // API.
146        split_packages: [
147            "android.nfc",
148            "android.nfc.cardemulation",
149        ],
150
151        // The following packages and all their subpackages currently only
152        // contain classes from this bootclasspath_fragment. Listing a package
153        // here won't prevent other bootclasspath modules from adding classes in
154        // any of those packages but it will prevent them from adding those
155        // classes into an API surface, e.g. public, system, etc.. Doing so will
156        // result in a build failure due to inconsistent flags.
157        package_prefixes: [
158            "android.nfc.dta",
159            "android.nfc.tech",
160            "com.android.nfc",
161        ],
162    },
163}
164