• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: ["hardware_interfaces_license"],
17}
18
19apex {
20    name: "com.android.hardware.usb",
21    manifest: "manifest.json",
22    file_contexts: "file_contexts",
23    key: "com.android.hardware.key",
24    certificate: ":com.android.hardware.certificate",
25    updatable: false,
26    vendor: true,
27
28    binaries: ["android.hardware.usb-service.example"],
29    prebuilts: [
30        "com.android.hardware.usb.rc", // init .rc
31        "android.hardware.usb.accessory.prebuilt.xml",
32        "android.hardware.usb.host.prebuilt.xml",
33        "android.hardware.usb-service.example.xml",
34    ],
35}
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"],
42    cmd: "sed -E 's@/vendor/bin@/apex/com.android.hardware.usb/bin@' $(in) > $(out)",
43}
44
45prebuilt_etc {
46    name: "com.android.hardware.usb.rc",
47    src: ":com.android.hardware.usb.rc-gen",
48    installable: false,
49}
50