xref: /aosp_15_r20/system/core/trusty/keymint/Android.bp (revision 00c7fec1bb09f3284aad6a6f96d2f63dfc3650ad)
1//
2// Copyright (C) 2022 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_defaults {
21    name: "android.hardware.security.keymint-service.rust.trusty.default",
22    relative_install_path: "hw",
23    srcs: [
24        "src/keymint_hal_main.rs",
25    ],
26    rustlibs: [
27        "libandroid_logger",
28        "libbinder_rs",
29        "libclap",
30        "libkmr_wire",
31        "libkmr_hal",
32        "libtrusty-rs",
33        "liblibc",
34        "liblog_rust",
35    ],
36    prefer_rlib: true,
37}
38
39rust_binary {
40    name: "android.hardware.security.keymint-service.rust.trusty",
41    vendor: true,
42    defaults: ["android.hardware.security.keymint-service.rust.trusty.default"],
43    init_rc: ["android.hardware.security.keymint-service.rust.trusty.rc"],
44    vintf_fragments: ["android.hardware.security.keymint-service.rust.trusty.xml"],
45    required: select(release_flag("RELEASE_AIDL_USE_UNFROZEN"), {
46        true: ["android.hardware.hardware_keystore.xml"],
47        default: ["android.hardware.hardware_keystore_V3.xml"],
48    }),
49}
50
51rust_binary {
52    name: "android.hardware.security.keymint-service.rust.trusty.system.nonsecure",
53    system_ext_specific: true,
54    defaults: ["android.hardware.security.keymint-service.rust.trusty.default"],
55    init_rc: ["android.hardware.security.keymint-service.rust.trusty.system.nonsecure.rc"],
56    features: ["nonsecure"],
57    rustlibs: [
58        "libkmr_hal_nonsecure",
59    ],
60}
61