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: "35", // Make it 36 once available.
28    sdk_version: "module_current",
29}
30
31java_defaults {
32    name: "NfcNciDefaults",
33    static_libs: [
34        "android.app.flags-aconfig-java",
35        "android.service.chooser.flags-aconfig-java",
36        "android.se.omapi-V1-java",
37        "androidx.annotation_annotation",
38        "androidx.appcompat_appcompat",
39        "bluetooth-protos-nfc-enums-java-gen",
40        "com.google.android.material_material",
41        "modules-utils-fastxmlserializer",
42        "modules-utils-shell-command-handler",
43        "PlatformProperties",
44        "nfc-event-log-proto",
45        "com.android.nfc.flags-aconfig-java",
46    ],
47    flags_packages: [
48        "com.android.nfc.flags-aconfig",
49    ],
50    privileged: true,
51    optimize: {
52        proguard_flags_files: ["proguard.flags"],
53    },
54    jarjar_rules: "jarjar-rules.txt",
55    privapp_allowlist: ":privapp_allowlist_com.android.nfc.xml",
56}
57
58// NCI Configuration used without NFC apex
59// This version compiles against platform.
60android_app {
61    name: "NfcNci",
62    defaults: ["NfcNciDefaults"],
63    certificate: "platform",
64    sdk_version: "core_platform",
65    srcs: [
66        ":nfc-sources",
67        "shim_src/non_apex/**/*.java",
68    ],
69    libs: [
70        // order matters: classes in framework-nfc are resolved before framework, meaning
71        // @hide APIs in framework-nfc are resolved before @SystemApi stubs in framework
72        "framework-nfc.impl",
73        "framework",
74
75        // if sdk_version="" this gets automatically included, but here we need to add manually.
76        "framework-res",
77    ],
78    jni_libs: ["libnfc_nci_jni"],
79    required: [
80        // Provide a default libnfc-nci.conf in /system/etc for devices that
81        // does not ship one in /product
82        "libnfc-nci.conf-default",
83    ],
84    lint: {
85        baseline_filename: "lint-baseline-nfcnci.xml",
86        warning_checks: [
87            "FlaggedApi",
88        ],
89    },
90}
91
92// NCI Configuration embedded in NFC apex.
93// This version compiles against SDK API's.
94android_app {
95    name: "NfcNciApex",
96    defaults: ["NfcNciDefaults"],
97    min_sdk_version: "35", // Make it 36 once available.
98    updatable: false, // TODO: fix this.
99    sdk_version: "module_current",
100    certificate: "nfc",
101    srcs: [
102        ":nfc-sources",
103        "shim_src/apex/**/*.java",
104    ],
105    libs: [
106        "android.nfc.flags-aconfig-java",
107        "android.permission.flags-aconfig-java",
108        "framework-annotations-lib",
109        "framework-bluetooth.stubs.module_lib",
110        "framework-configinfrastructure.stubs.module_lib",
111        "framework-nfc.impl",
112        "framework-permission-s.stubs.module_lib",
113        "framework-permission.stubs.module_lib",
114        "framework-statsd.stubs.module_lib",
115        "framework-wifi.stubs.module_lib",
116        "unsupportedappusage",
117    ],
118    // prevent NfcNciApex from using product-specific resources
119    aaptflags: ["--product default"],
120    apex_available: [
121        "//apex_available:platform",
122        "com.android.nfcservices",
123    ],
124    lint: {
125        baseline_filename: "lint-baseline.xml",
126    },
127}
128
129filegroup {
130    name: "nfc-sources",
131    srcs: [
132        "src/**/*.java",
133        "nci/**/*.java",
134        ":framework-nfc-javastream-protos",
135        ":statslog-Nfc-java-gen",
136    ],
137    visibility: [
138        "//packages/apps/Nfc/tests/unit",
139    ],
140}
141
142filegroup {
143    name: "privapp_allowlist_com.android.nfc.xml",
144    srcs: ["com.android.nfc.xml"],
145}
146