deyaoren@google.com | e1cab7b | 2021-11-17 23:22:03 +0000 | [diff] [blame] | 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 | |
| 15 | package { |
| 16 | default_applicable_licenses: ["hardware_interfaces_license"], |
| 17 | } |
| 18 | |
deyaoren@google.com | e1cab7b | 2021-11-17 23:22:03 +0000 | [diff] [blame] | 19 | apex { |
| 20 | name: "com.android.hardware.usb", |
| 21 | manifest: "manifest.json", |
| 22 | file_contexts: "file_contexts", |
Jooyung Han | d7447ae | 2023-10-10 12:59:46 +0900 | [diff] [blame^] | 23 | key: "com.android.hardware.key", |
| 24 | certificate: ":com.android.hardware.certificate", |
deyaoren@google.com | e1cab7b | 2021-11-17 23:22:03 +0000 | [diff] [blame] | 25 | updatable: false, |
Jooyung Han | d7447ae | 2023-10-10 12:59:46 +0900 | [diff] [blame^] | 26 | vendor: true, |
| 27 | |
Jooyung Han | c2a204e | 2022-11-15 18:17:33 +0900 | [diff] [blame] | 28 | binaries: ["android.hardware.usb-service.example"], |
deyaoren@google.com | e1cab7b | 2021-11-17 23:22:03 +0000 | [diff] [blame] | 29 | prebuilts: [ |
Jooyung Han | c2a204e | 2022-11-15 18:17:33 +0900 | [diff] [blame] | 30 | "com.android.hardware.usb.rc", // init .rc |
deyaoren@google.com | e1cab7b | 2021-11-17 23:22:03 +0000 | [diff] [blame] | 31 | "android.hardware.usb.accessory.prebuilt.xml", |
| 32 | "android.hardware.usb.host.prebuilt.xml", |
| 33 | ], |
Jooyung Han | c2a204e | 2022-11-15 18:17:33 +0900 | [diff] [blame] | 34 | vintf_fragments: [":android.hardware.usb-service.example.xml"], |
| 35 | } |
| 36 | |
| 37 | // Replace the binary path from /vendor/bin to /apex/{name}/bin in the init .rc file |
| 38 | genrule { |
| 39 | name: "com.android.hardware.usb.rc-gen", |
| 40 | srcs: [":android.hardware.usb-service.example.rc"], |
| 41 | out: ["com.android.hardware.usb.rc"], |
Jooyung Han | d7447ae | 2023-10-10 12:59:46 +0900 | [diff] [blame^] | 42 | cmd: "sed -E 's@/vendor/bin@/apex/com.android.hardware.usb/bin@' $(in) > $(out)", |
Jooyung Han | c2a204e | 2022-11-15 18:17:33 +0900 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | prebuilt_etc { |
| 46 | name: "com.android.hardware.usb.rc", |
| 47 | src: ":com.android.hardware.usb.rc-gen", |
| 48 | installable: false, |
deyaoren@google.com | e1cab7b | 2021-11-17 23:22:03 +0000 | [diff] [blame] | 49 | } |