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//
16
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "hardware_interfaces_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["hardware_interfaces_license"],
24}
25
26cc_defaults {
27    name: "android.hardware.boot-service_common",
28    relative_install_path: "hw",
29    defaults: ["libboot_control_defaults"],
30    srcs: [
31        "main.cpp",
32        "BootControl.cpp",
33    ],
34}
35
36cc_binary {
37    name: "android.hardware.boot-service.default",
38    defaults: ["android.hardware.boot-service_common"],
39    vendor: true,
40
41    stl: "c++_static",
42    shared_libs: [
43        "libbinder_ndk",
44        "liblog",
45    ],
46    static_libs: [
47        "android.hardware.boot@1.1",
48        "android.hardware.boot-V1-ndk",
49        "libbase",
50        "libboot_control",
51    ],
52
53    installable: false, // installed in APEX
54}
55
56cc_binary {
57    name: "android.hardware.boot-service.default_recovery",
58    defaults: ["android.hardware.boot-service_common"],
59    init_rc: ["android.hardware.boot-service.default_recovery.rc"],
60    vintf_fragments: ["android.hardware.boot-service.default.xml"],
61    recovery: true,
62
63    shared_libs: [
64        "libbase",
65        "libbinder_ndk",
66        "android.hardware.boot@1.1",
67        "android.hardware.boot-V1-ndk",
68    ],
69    static_libs: [
70        "libboot_control",
71    ],
72}
73
74prebuilt_etc {
75    name: "android.hardware.boot-service.default.rc",
76    src: "android.hardware.boot-service.default.rc",
77    installable: false,
78}
79
80prebuilt_etc {
81    name: "android.hardware.boot-service.default.xml",
82    src: "android.hardware.boot-service.default.xml",
83    sub_dir: "vintf",
84    installable: false,
85}
86
87apex {
88    name: "com.android.hardware.boot",
89    vendor: true,
90    manifest: "apex_manifest.json",
91    file_contexts: "apex_file_contexts",
92    key: "com.android.hardware.key",
93    certificate: ":com.android.hardware.certificate",
94    updatable: false,
95
96    binaries: [
97        "android.hardware.boot-service.default",
98    ],
99    prebuilts: [
100        "android.hardware.boot-service.default.rc",
101        "android.hardware.boot-service.default.xml",
102    ],
103}
104