From d254e37e32d7da09c8a3efc0af394b17f7dc3eda Mon Sep 17 00:00:00 2001 From: Jooyung Han Date: Wed, 13 Sep 2023 13:11:37 +0900 Subject: [PATCH] Add tetheroffload HAL APEX This is used by Cuttlefish as of now. Bug: 300011461 Test: VtsHalTetheroffloadTargetTest Change-Id: I3cd83d4011636e1ebfca5d20ed4ff7c527d5a63f --- tetheroffload/aidl/default/Android.bp | 44 ++++++++++++++++--- tetheroffload/aidl/default/apex_file_contexts | 3 ++ tetheroffload/aidl/default/apex_manifest.json | 4 ++ .../aidl/default/tetheroffload-example.rc | 2 +- 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 tetheroffload/aidl/default/apex_file_contexts create mode 100644 tetheroffload/aidl/default/apex_manifest.json diff --git a/tetheroffload/aidl/default/Android.bp b/tetheroffload/aidl/default/Android.bp index 8f0739c3d9..8c969900fc 100644 --- a/tetheroffload/aidl/default/Android.bp +++ b/tetheroffload/aidl/default/Android.bp @@ -19,18 +19,52 @@ package { cc_binary { name: "android.hardware.tetheroffload-service.example", relative_install_path: "hw", - init_rc: ["tetheroffload-example.rc"], - vintf_fragments: ["tetheroffload-example.xml"], vendor: true, - shared_libs: [ + + stl: "c++_static", + static_libs: [ "android.hardware.tetheroffload-V1-ndk", "libbase", + ], + shared_libs: [ "libbinder_ndk", - "libcutils", - "libutils", + "liblog", ], srcs: [ "main.cpp", "Offload.cpp", ], + + installable: false, // installed in APEX +} + +prebuilt_etc { + name: "tetheroffload-example.rc", + src: "tetheroffload-example.rc", + installable: false, +} + +prebuilt_etc { + name: "tetheroffload-example.xml", + src: "tetheroffload-example.xml", + sub_dir: "vintf", + installable: false, +} + +apex { + name: "com.android.hardware.tetheroffload", + 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.tetheroffload-service.example", + ], + prebuilts: [ + "tetheroffload-example.rc", + "tetheroffload-example.xml", + ], } diff --git a/tetheroffload/aidl/default/apex_file_contexts b/tetheroffload/aidl/default/apex_file_contexts new file mode 100644 index 0000000000..a520101e41 --- /dev/null +++ b/tetheroffload/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\.tetheroffload-service\.example u:object_r:hal_tetheroffload_default_exec:s0 diff --git a/tetheroffload/aidl/default/apex_manifest.json b/tetheroffload/aidl/default/apex_manifest.json new file mode 100644 index 0000000000..4c90889864 --- /dev/null +++ b/tetheroffload/aidl/default/apex_manifest.json @@ -0,0 +1,4 @@ +{ + "name": "com.android.hardware.tetheroffload", + "version": 1 +} diff --git a/tetheroffload/aidl/default/tetheroffload-example.rc b/tetheroffload/aidl/default/tetheroffload-example.rc index 46cda61d02..b95544b7f2 100644 --- a/tetheroffload/aidl/default/tetheroffload-example.rc +++ b/tetheroffload/aidl/default/tetheroffload-example.rc @@ -1,4 +1,4 @@ -service vendor.tetheroffload-example /vendor/bin/hw/android.hardware.tetheroffload-service.example +service vendor.tetheroffload-example /apex/com.android.hardware.tetheroffload/bin/hw/android.hardware.tetheroffload-service.example class hal user nobody group nobody