diff --git a/dumpstate/aidl/default/Android.bp b/dumpstate/aidl/default/Android.bp index 45fdc17d31..a9da69c0c2 100644 --- a/dumpstate/aidl/default/Android.bp +++ b/dumpstate/aidl/default/Android.bp @@ -44,3 +44,41 @@ cc_binary { "-DLOG_TAG=\"android.hardware.dumpstate-service.example\"", ], } + +prebuilt_etc { + name: "dumpstate-default.xml", + src: "dumpstate-default.xml", + sub_dir: "vintf", + installable: false, +} + +prebuilt_etc { + name: "dumpstate-default.rc", + src: ":gen-dumpstate-default.rc-for-apex", + installable: false, +} + +genrule { + name: "gen-dumpstate-default.rc-for-apex", + srcs: ["dumpstate-default.rc"], + out: ["dumpstate-default-apex.rc"], + cmd: "sed -E 's/\\/vendor\\/bin\\/hw/\\/apex\\/com.android.hardware.dumpstate\\/bin\\/hw/' $(in) > $(out)", +} + +apex { + name: "com.android.hardware.dumpstate", + 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.dumpstate-service.example", + ], + prebuilts: [ + "dumpstate-default.rc", + "dumpstate-default.xml", + ], +} diff --git a/dumpstate/aidl/default/apex_file_contexts b/dumpstate/aidl/default/apex_file_contexts new file mode 100644 index 0000000000..91153a9550 --- /dev/null +++ b/dumpstate/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\.dumpstate-service\.example u:object_r:hal_dumpstate_default_exec:s0 \ No newline at end of file diff --git a/dumpstate/aidl/default/apex_manifest.json b/dumpstate/aidl/default/apex_manifest.json new file mode 100644 index 0000000000..32beea49c8 --- /dev/null +++ b/dumpstate/aidl/default/apex_manifest.json @@ -0,0 +1,4 @@ +{ + "name": "com.android.hardware.dumpstate", + "version": 1 +} \ No newline at end of file