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