• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_binary {
21    name: "android.hardware.security.keymint-service.rust",
22    relative_install_path: "hw",
23    vendor: true,
24    srcs: ["src/keymint_hal_main.rs"],
25    rustlibs: [
26        "libandroid_logger",
27        "libbinder_rs",
28        "libhex",
29        "libkmr_hal",
30        "libkmr_hal_nonsecure",
31        "libkmr_wire",
32        "liblibc",
33        "liblog_rust",
34    ],
35    prefer_rlib: true,
36}
37
38// init_rc
39prebuilt_etc {
40    name: "android.hardware.security.keymint-service.rust.rc",
41    vendor: true,
42    src: "android.hardware.security.keymint-service.rust.rc",
43}
44
45// vintf_fragments
46prebuilt_etc {
47    name: "android.hardware.security.keymint-service.rust.xml",
48    sub_dir: "vintf",
49    vendor: true,
50    src: "android.hardware.security.keymint-service.rust.xml",
51}
52
53prebuilt_etc {
54    name: "android.hardware.security.sharedsecret-service.rust.xml",
55    sub_dir: "vintf",
56    vendor: true,
57    src: "android.hardware.security.sharedsecret-service.rust.xml",
58}
59
60prebuilt_etc {
61    name: "android.hardware.security.secureclock-service.rust.xml",
62    sub_dir: "vintf",
63    vendor: true,
64    src: "android.hardware.security.secureclock-service.rust.xml",
65}
66
67apex_defaults {
68    name: "com.android.hardware.keymint.rust_defaults",
69    manifest: "manifest.json",
70    key: "com.google.cf.apex.key",
71    certificate: ":com.google.cf.apex.certificate",
72    soc_specific: true,
73    updatable: false,
74    prebuilts: [
75        // permissions
76        "android.hardware.hardware_keystore.xml",
77    ],
78}
79
80apex {
81    name: "com.android.hardware.keymint.rust_cf_remote",
82    defaults: ["com.android.hardware.keymint.rust_defaults"],
83    file_contexts: "file_contexts",
84    binaries: [
85        "android.hardware.security.keymint-service.rust",
86    ],
87    prebuilts: [
88        // init_rc
89        "android.hardware.security.keymint-service.rust.rc",
90        // vintf_fragments
91        "android.hardware.security.keymint-service.rust.xml",
92        "android.hardware.security.secureclock-service.rust.xml",
93        "android.hardware.security.sharedsecret-service.rust.xml",
94    ],
95}
96
97apex {
98    name: "com.android.hardware.keymint.rust_cf_guest_trusty_nonsecure",
99    defaults: ["com.android.hardware.keymint.rust_defaults"],
100    file_contexts: "file_contexts_trusty",
101    prebuilts: [
102        // vintf_fragments
103        "android.hardware.security.keymint-service.trusty_system_vm.xml",
104    ],
105}
106