1//
2// Copyright (C) 2021 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20rust_binary {
21    name: "android.hardware.nfc-service.cuttlefish",
22    relative_install_path: "hw",
23    vendor: true,
24    prefer_rlib: true,
25    rustlibs: [
26        "libandroid_logger",
27        "liblog_rust",
28        "libbinder_rs",
29        "libbinder_tokio_rs",
30        "libtokio",
31        "liblibc",
32        "libnix",
33        "libclap",
34        "android.hardware.nfc-V1-rust",
35        "libanyhow",
36        "libthiserror",
37        "libbytes",
38        "libpdl_runtime",
39    ],
40    proc_macros: [
41        "libasync_trait",
42    ],
43    features: ["rt"],
44    srcs: [
45        "src/main.rs",
46        ":casimir_nci_packets_rust_gen",
47    ],
48}
49
50prebuilt_etc {
51    name: "nfc-service-cuttlefish.rc",
52    src: "nfc-service-cuttlefish.rc",
53    installable: false,
54}
55
56prebuilt_etc {
57    name: "nfc-service-cuttlefish.xml",
58    src: "nfc-service-cuttlefish.xml",
59    sub_dir: "vintf",
60    installable: false,
61}
62
63apex {
64    name: "com.google.cf.nfc",
65    manifest: "apex_manifest.json",
66    file_contexts: "file_contexts",
67    key: "com.google.cf.apex.key",
68    certificate: ":com.google.cf.apex.certificate",
69    updatable: false,
70    vendor: true,
71
72    binaries: ["android.hardware.nfc-service.cuttlefish"],
73    prebuilts: [
74        "nfc-service-cuttlefish.rc", // init_rc
75        "nfc-service-cuttlefish.xml", // vintf_fragments
76        "android.hardware.nfc.prebuilt.xml", // permission
77        "android.hardware.nfc.hce.prebuilt.xml", // permission
78        "libnfc-hal-cf.conf-default", // conf
79    ],
80}
81