diff --git a/memtrack/aidl/default/Android.bp b/memtrack/aidl/default/Android.bp index 6c77177fda..cf95bbbf5e 100644 --- a/memtrack/aidl/default/Android.bp +++ b/memtrack/aidl/default/Android.bp @@ -37,3 +37,56 @@ cc_binary { "Memtrack.cpp", ], } + +cc_binary { + name: "android.hardware.memtrack-service.apex", + stem: "android.hardware.memtrack-service.example", + relative_install_path: "hw", + vendor: true, + + stl: "c++_static", + static_libs: [ + "libbase", + "android.hardware.memtrack-V1-ndk", + ], + shared_libs: [ + "libbinder_ndk", + "liblog", + ], + srcs: [ + "main.cpp", + "Memtrack.cpp", + ], + installable: false, // installed in APEX +} + +prebuilt_etc { + name: "memtrack-default-apex.rc", + src: "memtrack-default-apex.rc", + installable: false, +} + +prebuilt_etc { + name: "memtrack-default.xml", + src: "memtrack-default.xml", + sub_dir: "vintf", + installable: false, +} + +apex { + name: "com.android.hardware.memtrack", + file_contexts: "apex_file_contexts", + manifest: "apex_manifest.json", + key: "com.android.hardware.key", + certificate: ":com.android.hardware.certificate", + updatable: false, + vendor: true, + + binaries: [ + "android.hardware.memtrack-service.apex", + ], + prebuilts: [ + "memtrack-default-apex.rc", + "memtrack-default.xml", + ], +} diff --git a/memtrack/aidl/default/apex_file_contexts b/memtrack/aidl/default/apex_file_contexts new file mode 100644 index 0000000000..40c0af4593 --- /dev/null +++ b/memtrack/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\.memtrack-service\.example u:object_r:hal_memtrack_default_exec:s0 diff --git a/memtrack/aidl/default/apex_manifest.json b/memtrack/aidl/default/apex_manifest.json new file mode 100644 index 0000000000..16d195ecc1 --- /dev/null +++ b/memtrack/aidl/default/apex_manifest.json @@ -0,0 +1,4 @@ +{ + "name": "com.android.hardware.memtrack", + "version": 1 +} \ No newline at end of file diff --git a/memtrack/aidl/default/memtrack-default-apex.rc b/memtrack/aidl/default/memtrack-default-apex.rc new file mode 100644 index 0000000000..53e712a1b0 --- /dev/null +++ b/memtrack/aidl/default/memtrack-default-apex.rc @@ -0,0 +1,4 @@ +service vendor.memtrack-default /apex/com.android.hardware.memtrack/bin/hw/android.hardware.memtrack-service.example + class hal + user nobody + group system