From 798af3b38d0503a7dd0e6eaa0cb816bc8fa4c3f8 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Tue, 19 Sep 2023 14:03:44 +0900 Subject: [PATCH] Add contexthub HAL APEX It's typical to make the HAL binary to link its dependencies statically to make the resulting APEX smaller. Will do it as a follow-up. Bug: 297467264 Test: VtsAidlHalContextHubTargetTest Change-Id: Icbc558d81a473b5ea01d2d0b5f7090fcb5365085 --- contexthub/aidl/default/Android.bp | 31 +++++++++++++++++++ ...oid.hardware.contexthub-service.example.rc | 4 +++ contexthub/aidl/default/apex_file_contexts | 3 ++ contexthub/aidl/default/apex_manifest.json | 4 +++ 4 files changed, 42 insertions(+) create mode 100644 contexthub/aidl/default/android.hardware.contexthub-service.example.rc create mode 100644 contexthub/aidl/default/apex_file_contexts create mode 100644 contexthub/aidl/default/apex_manifest.json diff --git a/contexthub/aidl/default/Android.bp b/contexthub/aidl/default/Android.bp index 269057a2a2..4bcdda823b 100644 --- a/contexthub/aidl/default/Android.bp +++ b/contexthub/aidl/default/Android.bp @@ -57,3 +57,34 @@ cc_binary { ], srcs: ["main.cpp"], } + +prebuilt_etc { + name: "android.hardware.contexthub-service.example.rc", + src: "android.hardware.contexthub-service.example.rc", + installable: false, +} + +prebuilt_etc { + name: "contexthub-default.xml", + src: "contexthub-default.xml", + sub_dir: "vintf", + installable: false, +} + +apex { + name: "com.android.hardware.contexthub", + vendor: true, + manifest: "apex_manifest.json", + file_contexts: "apex_file_contexts", + key: "com.android.hardware.key", + certificate: ":com.android.hardware.certificate", + updatable: false, + + binaries: [ + "android.hardware.contexthub-service.example", + ], + prebuilts: [ + "android.hardware.contexthub-service.example.rc", + "contexthub-default.xml", + ], +} diff --git a/contexthub/aidl/default/android.hardware.contexthub-service.example.rc b/contexthub/aidl/default/android.hardware.contexthub-service.example.rc new file mode 100644 index 0000000000..7d5d2aa90f --- /dev/null +++ b/contexthub/aidl/default/android.hardware.contexthub-service.example.rc @@ -0,0 +1,4 @@ +service vendor.contexthub-default /apex/com.android.hardware.contexthub/bin/hw/android.hardware.contexthub-service.example + class hal + user context_hub + group context_hub diff --git a/contexthub/aidl/default/apex_file_contexts b/contexthub/aidl/default/apex_file_contexts new file mode 100644 index 0000000000..c3c67df9fb --- /dev/null +++ b/contexthub/aidl/default/apex_file_contexts @@ -0,0 +1,3 @@ +(/.*)? u:object_r:vendor_file:s0 +/etc(/.*)? u:object_r:vendor_configs_file:s0 +/bin/hw/android\.hardware\.contexthub-service\.example u:object_r:hal_contexthub_default_exec:s0 diff --git a/contexthub/aidl/default/apex_manifest.json b/contexthub/aidl/default/apex_manifest.json new file mode 100644 index 0000000000..aed7081fd8 --- /dev/null +++ b/contexthub/aidl/default/apex_manifest.json @@ -0,0 +1,4 @@ +{ + "name": "com.android.hardware.contexthub", + "version": 1 +} \ No newline at end of file