From 78c24f8854020d668aad0fd56a5e64931f6ea123 Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Sat, 4 Nov 2023 00:29:07 +0900 Subject: [PATCH] Add gnss HAL APEX Bug: 297467836 Test: VtsHalGnssTargetTest Change-Id: I193ad310cfeabd21fc6beefeaef460487754c7c2 --- gnss/aidl/default/Android.bp | 39 +++++++++++++++++++++++----- gnss/aidl/default/apex_file_contexts | 3 +++ gnss/aidl/default/apex_manifest.json | 4 +++ gnss/aidl/default/gnss-default.rc | 2 +- 4 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 gnss/aidl/default/apex_file_contexts create mode 100644 gnss/aidl/default/apex_manifest.json diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp index ca5a41f8e5..731092271d 100644 --- a/gnss/aidl/default/Android.bp +++ b/gnss/aidl/default/Android.bp @@ -26,12 +26,7 @@ package { cc_binary { name: "android.hardware.gnss-service.example", relative_install_path: "hw", - init_rc: [ - "gnss-default.rc", - ], - vintf_fragments: [ - "gnss-default.xml", - ], + installable: false, // install APEX instead vendor: true, cflags: [ "-Wall", @@ -73,3 +68,35 @@ cc_binary { "android.hardware.gnss@common-default-lib", ], } + +prebuilt_etc { + name: "gnss-default.rc", + src: "gnss-default.rc", + installable: false, +} + +prebuilt_etc { + name: "gnss-default.xml", + src: "gnss-default.xml", + sub_dir: "vintf", + installable: false, +} + +apex { + name: "com.android.hardware.gnss", + manifest: "apex_manifest.json", + file_contexts: "apex_file_contexts", + key: "com.android.hardware.key", + certificate: ":com.android.hardware.certificate", + updatable: false, + vendor: true, + + binaries: [ + "android.hardware.gnss-service.example", + ], + prebuilts: [ + "gnss-default.rc", + "gnss-default.xml", + "android.hardware.location.gps.prebuilt.xml", // permission + ], +} diff --git a/gnss/aidl/default/apex_file_contexts b/gnss/aidl/default/apex_file_contexts new file mode 100644 index 0000000000..83b01ed993 --- /dev/null +++ b/gnss/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\.gnss-service\.example u:object_r:hal_gnss_default_exec:s0 diff --git a/gnss/aidl/default/apex_manifest.json b/gnss/aidl/default/apex_manifest.json new file mode 100644 index 0000000000..9b2db23fb0 --- /dev/null +++ b/gnss/aidl/default/apex_manifest.json @@ -0,0 +1,4 @@ +{ + "name": "com.android.hardware.gnss", + "version": 1 +} diff --git a/gnss/aidl/default/gnss-default.rc b/gnss/aidl/default/gnss-default.rc index fe179c34f0..d47b3a5aee 100644 --- a/gnss/aidl/default/gnss-default.rc +++ b/gnss/aidl/default/gnss-default.rc @@ -1,4 +1,4 @@ -service vendor.gnss-default /vendor/bin/hw/android.hardware.gnss-service.example +service vendor.gnss-default /apex/com.android.hardware.gnss/bin/hw/android.hardware.gnss-service.example class hal user nobody group nobody