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