| // Copyright (C) 2023 The Android Open Source Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| package { |
| default_team: "trendy_team_fwk_nfc", |
| default_applicable_licenses: ["Android-Apache-2.0"], |
| } |
| |
| apex_key { |
| name: "com.android.nfcservices.key", |
| public_key: "com.android.nfcservices.avbpubkey", |
| private_key: "com.android.nfcservices.pem", |
| } |
| |
| android_app_certificate { |
| name: "com.android.nfcservices.certificate", |
| certificate: "com.android.nfcservices", |
| } |
| |
| soong_config_module_type { |
| name: "custom_apex", |
| module_type: "apex", |
| config_namespace: "bootclasspath", |
| bool_variables: [ |
| "nfc_apex_bootclasspath_fragment", |
| ], |
| properties: [ |
| "bootclasspath_fragments", |
| ], |
| } |
| |
| custom_apex { |
| name: "com.android.nfcservices", |
| manifest: "manifest.json", |
| apps: ["NfcNciApex"], |
| defaults: ["b-launched-apex-module"], |
| min_sdk_version: "35", // Make it 36 once available. |
| multilib: { |
| first: { |
| // Extractor process runs only with the primary ABI. |
| jni_libs: [ |
| "libnfc_nci_jni", |
| ], |
| }, |
| }, |
| soong_config_variables: { |
| nfc_apex_bootclasspath_fragment: { |
| bootclasspath_fragments: ["com.android.nfcservices-bootclasspath-fragment"], |
| }, |
| }, |
| // For non-mainline builds |
| required: [ |
| // Provide a default libnfc-nci.conf in /system/etc for devices that |
| // does not ship one in /product |
| "libnfc-nci.conf-default", |
| ], |
| // For mainline builds |
| prebuilts: [ |
| // Provide a default libnfc-nci.conf in /system/etc for devices that |
| // does not ship one in /product |
| "libnfc-nci.conf-default", |
| ], |
| file_contexts: ":com.android.nfcservices-file_contexts", |
| key: "com.android.nfcservices.key", |
| certificate: ":com.android.nfcservices.certificate", |
| visibility: [ |
| "//build/make/target:__subpackages__", |
| "//vendor:__subpackages__", |
| ], |
| } |
| |
| sdk { |
| name: "nfcservices-module-sdk", |
| apexes: [ |
| // Adds exportable dependencies of the APEX to the sdk, |
| // e.g. *classpath_fragments. |
| "com.android.nfcservices", |
| ], |
| } |
| |
| soong_config_module_type { |
| name: "custom_bootclasspath_fragment", |
| module_type: "bootclasspath_fragment", |
| config_namespace: "bootclasspath", |
| bool_variables: [ |
| "nfc_apex_bootclasspath_fragment", |
| ], |
| properties: [ |
| "enabled", |
| ], |
| } |
| |
| // Encapsulate the contributions made by the com.android.nfc to the bootclasspath. |
| custom_bootclasspath_fragment { |
| name: "com.android.nfcservices-bootclasspath-fragment", |
| contents: ["framework-nfc"], |
| apex_available: ["com.android.nfcservices"], |
| // This is disabled for now since the build system does not allow for adding a bootclasspath |
| // fragment and conditionally adding it to PRODUCT_APEX_BOOT_JARS. |
| // When `RELEASE_PACKAGE_NFC_STACK` is set to `com.android.nfcservices`, this needs to be |
| // set to true. |
| enabled: false, |
| soong_config_variables: { |
| nfc_apex_bootclasspath_fragment: { |
| enabled: true, |
| }, |
| }, |
| |
| // The bootclasspath_fragments that provide APIs on which this depends. |
| fragments: [ |
| // Needed to access core java APIs. |
| { |
| apex: "com.android.art", |
| module: "art-bootclasspath-fragment", |
| }, |
| ], |
| |
| // Additional stubs libraries that this fragment's contents use which are |
| // not provided by another bootclasspath_fragment. |
| additional_stubs: [ |
| // Needed to access platform APIs. |
| "android-non-updatable", |
| ], |
| hidden_api: { |
| // Additional hidden API flag files to override the defaults. This must only be |
| // modified by the Soong or platform compat team. |
| max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o.txt"], |
| max_target_r_low_priority: ["hiddenapi/hiddenapi-max-target-r-loprio.txt"], |
| |
| // The following packages contain classes from other modules on the |
| // bootclasspath. That means that the hidden API flags for this module |
| // has to explicitly list every single class this module provides in |
| // that package to differentiate them from the classes provided by other |
| // modules. That can include private classes that are not part of the |
| // API. |
| split_packages: [ |
| "android.nfc", |
| "android.nfc.cardemulation", |
| ], |
| |
| // The following packages and all their subpackages currently only |
| // contain classes from this bootclasspath_fragment. Listing a package |
| // here won't prevent other bootclasspath modules from adding classes in |
| // any of those packages but it will prevent them from adding those |
| // classes into an API surface, e.g. public, system, etc.. Doing so will |
| // result in a build failure due to inconsistent flags. |
| package_prefixes: [ |
| "android.nfc.dta", |
| "android.nfc.tech", |
| "com.android.nfc", |
| ], |
| }, |
| } |