blob: 29278dd761a756c72470222304b82926e5cbfca2 [file] [log] [blame]
deyaoren@google.come1cab7b2021-11-17 23:22:03 +00001// 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: ["hardware_interfaces_license"],
17}
18
deyaoren@google.come1cab7b2021-11-17 23:22:03 +000019apex {
20 name: "com.android.hardware.usb",
21 manifest: "manifest.json",
22 file_contexts: "file_contexts",
Jooyung Hand7447ae2023-10-10 12:59:46 +090023 key: "com.android.hardware.key",
24 certificate: ":com.android.hardware.certificate",
deyaoren@google.come1cab7b2021-11-17 23:22:03 +000025 updatable: false,
Jooyung Hand7447ae2023-10-10 12:59:46 +090026 vendor: true,
27
Jooyung Hanc2a204e2022-11-15 18:17:33 +090028 binaries: ["android.hardware.usb-service.example"],
deyaoren@google.come1cab7b2021-11-17 23:22:03 +000029 prebuilts: [
Jooyung Hanc2a204e2022-11-15 18:17:33 +090030 "com.android.hardware.usb.rc", // init .rc
deyaoren@google.come1cab7b2021-11-17 23:22:03 +000031 "android.hardware.usb.accessory.prebuilt.xml",
32 "android.hardware.usb.host.prebuilt.xml",
Jooyung Hanf9cfbd52023-10-10 13:40:22 +090033 "android.hardware.usb-service.example.xml",
deyaoren@google.come1cab7b2021-11-17 23:22:03 +000034 ],
Jooyung Hanc2a204e2022-11-15 18:17:33 +090035}
36
37// Replace the binary path from /vendor/bin to /apex/{name}/bin in the init .rc file
38genrule {
39 name: "com.android.hardware.usb.rc-gen",
40 srcs: [":android.hardware.usb-service.example.rc"],
41 out: ["com.android.hardware.usb.rc"],
Jooyung Hand7447ae2023-10-10 12:59:46 +090042 cmd: "sed -E 's@/vendor/bin@/apex/com.android.hardware.usb/bin@' $(in) > $(out)",
Jooyung Hanc2a204e2022-11-15 18:17:33 +090043}
44
45prebuilt_etc {
46 name: "com.android.hardware.usb.rc",
47 src: ":com.android.hardware.usb.rc-gen",
48 installable: false,
deyaoren@google.come1cab7b2021-11-17 23:22:03 +000049}