1// Copyright (C) 2021 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19genrule {
20    name: "com.android.hardware.power.rc-srcs",
21    srcs: [
22        ":android.hardware.power.rc",
23        ":android.hardware.power.stats.rc",
24    ],
25    out: ["com.android.hardware.power.rc"],
26    cmd: "sed -E 's@/vendor/bin/@/apex/com.android.hardware.power/bin/@' $(in) > $(out)",
27}
28
29prebuilt_etc {
30    name: "com.android.hardware.power.rc",
31    src: ":com.android.hardware.power.rc-srcs",
32    installable: false,
33}
34
35apex {
36    name: "com.android.hardware.power",
37    manifest: "apex_manifest.json",
38    key: "com.android.hardware.key",
39    certificate: ":com.android.hardware.certificate",
40    file_contexts: "file_contexts",
41    updatable: false,
42    vendor: true,
43
44    // Bundle the Power and PowerStats HALs into this one APEX.
45    binaries: [
46        "android.hardware.power-service.example",
47        "android.hardware.power.stats-service.example",
48    ],
49    prebuilts: [
50        "com.android.hardware.power.rc",
51        "android.hardware.power.xml",
52        "android.hardware.power.stats.xml",
53    ],
54    overrides: [
55        // Shared lib installed by default but unused by the AIDL implementation.
56        "power.default",
57    ],
58}
59