1package {
2    default_team: "trendy_team_fwk_nfc",
3    default_applicable_licenses: ["Android-Apache-2.0"],
4}
5
6genrule {
7    name: "statslog-Nfc-java-gen",
8    tools: ["stats-log-api-gen"],
9    cmd: "$(location stats-log-api-gen) --java $(out) --module nfc --javaPackage com.android.nfc" +
10        " --javaClass NfcStatsLog",
11    out: ["com/android/nfc/NfcStatsLog.java"],
12}
13
14java_library {
15    name: "bluetooth-protos-nfc-enums-java-gen",
16    installable: false,
17    proto: {
18        type: "stream",
19    },
20    srcs: [
21        ":srcs_bluetooth_protos_nfc",
22    ],
23    apex_available: [
24        "//apex_available:platform",
25        "com.android.nfcservices",
26    ],
27    min_sdk_version: "current",
28    sdk_version: "module_current",
29}
30
31java_defaults {
32    name: "NfcNciDefaults",
33    static_libs: [
34        "android.se.omapi-V1-java",
35        "androidx.annotation_annotation",
36        "androidx.appcompat_appcompat",
37        "bluetooth-protos-nfc-enums-java-gen",
38        "com.google.android.material_material",
39        "modules-utils-fastxmlserializer",
40        "modules-utils-shell-command-handler",
41        "PlatformProperties",
42        "nfc-event-log-proto",
43        "nfc_flags_lib",
44    ],
45    privileged: true,
46    optimize: {
47        proguard_flags_files: ["proguard.flags"],
48    },
49    jarjar_rules: "jarjar-rules.txt",
50    privapp_allowlist: ":privapp_allowlist_com.android.nfc.xml",
51}
52
53// NCI Configuration used without NFC apex
54// This version compiles against platform.
55android_app {
56    name: "NfcNci",
57    defaults: ["NfcNciDefaults"],
58    certificate: "platform",
59    sdk_version: "core_platform",
60    srcs: [
61        ":nfc-sources",
62        "shim_src/non_apex/**/*.java",
63    ],
64    libs: [
65        // order matters: classes in framework-nfc are resolved before framework, meaning
66        // @hide APIs in framework-nfc are resolved before @SystemApi stubs in framework
67        "framework-nfc.impl",
68        "framework",
69
70        // if sdk_version="" this gets automatically included, but here we need to add manually.
71        "framework-res",
72    ],
73    jni_libs: ["libnfc_nci_jni"],
74    required: [
75        // Provide a default libnfc-nci.conf in /system/etc for devices that
76        // does not ship one in /product
77        "libnfc-nci.conf-default",
78    ],
79}
80
81// NCI Configuration embedded in NFC apex.
82// This version compiles against SDK API's.
83android_app {
84    name: "NfcNciApex",
85    defaults: ["NfcNciDefaults"],
86    min_sdk_version: "current",
87    sdk_version: "module_current",
88    certificate: "nfc",
89    srcs: [
90        ":nfc-sources",
91        "shim_src/apex/**/*.java",
92    ],
93    libs: [
94        "framework-annotations-lib",
95        "framework-bluetooth",
96        "framework-configinfrastructure",
97        "framework-nfc.impl",
98        "framework-permission-s",
99        "framework-permission",
100        "framework-statsd.stubs.module_lib",
101        "framework-wifi",
102        "android.nfc.flags-aconfig-java",
103        "android.permission.flags-aconfig-java-export",
104        "android.service.chooser.flags-aconfig-java",
105        "unsupportedappusage",
106    ],
107    // prevent NfcNciApex from using product-specific resources
108    aaptflags: ["--product default"],
109    apex_available: [
110        "//apex_available:platform",
111        "com.android.nfcservices",
112    ],
113    lint: {
114        baseline_filename: "lint-baseline.xml",
115    },
116}
117
118filegroup {
119    name: "nfc-sources",
120    srcs: [
121        "src/**/*.java",
122        "nci/**/*.java",
123        ":framework-nfc-javastream-protos",
124        ":statslog-Nfc-java-gen",
125    ],
126    visibility: [
127        "//packages/apps/Nfc/tests/unit",
128    ],
129}
130
131filegroup {
132    name: "privapp_allowlist_com.android.nfc.xml",
133    srcs: ["com.android.nfc.xml"],
134}
135