Merge "USB APEX with AIDL implementation"

This commit is contained in:
Jooyung Han
2022-11-17 04:05:28 +00:00
committed by Gerrit Code Review
10 changed files with 35 additions and 34 deletions

View File

@@ -21,21 +21,11 @@ package {
default_applicable_licenses: ["hardware_interfaces_license"],
}
filegroup {
name: "android.hardware.usb@1.0-service.xml",
srcs: ["android.hardware.usb@1.0-service.xml"],
}
filegroup {
name: "android.hardware.usb@1.0-service.rc",
srcs: ["android.hardware.usb@1.0-service.rc"],
}
cc_binary {
name: "android.hardware.usb@1.0-service",
defaults: ["hidl_defaults"],
init_rc: [":android.hardware.usb@1.0-service.rc"],
vintf_fragments: [":android.hardware.usb@1.0-service.xml"],
init_rc: ["android.hardware.usb@1.0-service.rc"],
vintf_fragments: ["android.hardware.usb@1.0-service.xml"],
relative_install_path: "hw",
vendor: true,
srcs: [

View File

@@ -1,4 +0,0 @@
{
"name": "com.android.hardware.usb",
"version": 1
}

View File

@@ -37,8 +37,18 @@ cc_binary {
"android.hardware.usb-V1-ndk",
"libbase",
"libbinder_ndk",
"libcutils",
"libcutils",
"liblog",
"libutils",
],
}
filegroup {
name: "android.hardware.usb-service.example.xml",
srcs: ["android.hardware.usb-service.example.xml"],
}
filegroup {
name: "android.hardware.usb-service.example.rc",
srcs: ["android.hardware.usb-service.example.rc"],
}

View File

@@ -27,19 +27,6 @@ android_app_certificate {
certificate: "com.android.hardware.usb",
}
genrule {
name: "com.android.hardware.usb.rc-gen",
srcs: [":android.hardware.usb@1.0-service.rc"],
out: ["com.android.hardware.usb.rc"],
cmd: "sed -E 's/\\/vendor/\\/apex\\/com.android.hardware.usb/' $(in) > $(out)",
}
prebuilt_etc {
name: "com.android.hardware.usb.rc",
src: ":com.android.hardware.usb.rc-gen",
installable: false,
}
apex {
name: "com.android.hardware.usb",
manifest: "manifest.json",
@@ -49,11 +36,25 @@ apex {
updatable: false,
soc_specific: true,
use_vndk_as_stable: true,
binaries: ["android.hardware.usb@1.0-service"],
binaries: ["android.hardware.usb-service.example"],
prebuilts: [
"com.android.hardware.usb.rc",
"com.android.hardware.usb.rc", // init .rc
"android.hardware.usb.accessory.prebuilt.xml",
"android.hardware.usb.host.prebuilt.xml",
],
vintf_fragments: [":android.hardware.usb@1.0-service.xml"],
vintf_fragments: [":android.hardware.usb-service.example.xml"],
}
// Replace the binary path from /vendor/bin to /apex/{name}/bin in the init .rc file
genrule {
name: "com.android.hardware.usb.rc-gen",
srcs: [":android.hardware.usb-service.example.rc"],
out: ["com.android.hardware.usb.rc"],
cmd: "sed -E 's/\\/vendor/\\/apex\\/com.android.hardware.usb/' $(in) > $(out)",
}
prebuilt_etc {
name: "com.android.hardware.usb.rc",
src: ":com.android.hardware.usb.rc-gen",
installable: false,
}

View File

@@ -2,4 +2,4 @@
# Permission XMLs
/etc/permissions(/.*)? u:object_r:vendor_configs_file:s0
# binary
/bin/hw/android\.hardware\.usb@1\.0-service u:object_r:hal_usb_default_exec:s0
/bin/hw/android\.hardware\.usb-service\.example u:object_r:hal_usb_default_exec:s0

4
usb/apex/manifest.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "com.android.hardware.usb",
"version": 1
}