From ae3f1fb976c8861982a42077133adf0f51fc240b Mon Sep 17 00:00:00 2001 From: Kenn Frankel Date: Thu, 19 Oct 2023 17:47:27 -0700 Subject: [PATCH] Convert Nlinterceptor HAL to Vendor Apex (CF) Bug: 300011249 Test: atest VtsHalNetlinkInterceptorV1_0Test Change-Id: I521877b24354ff95eb941daf314ca1f14d37bd70 --- .../aidl/default/Android.bp | 33 +++++++++++++++++-- .../aidl/default/apex_file_contexts | 3 ++ .../aidl/default/apex_manifest.json | 4 +++ .../aidl/default/nlinterceptor-default.rc | 4 --- .../aidl/default/nlinterceptor.rc | 4 +++ ...erceptor-default.xml => nlinterceptor.xml} | 0 6 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 wifi/netlinkinterceptor/aidl/default/apex_file_contexts create mode 100644 wifi/netlinkinterceptor/aidl/default/apex_manifest.json delete mode 100644 wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc create mode 100644 wifi/netlinkinterceptor/aidl/default/nlinterceptor.rc rename wifi/netlinkinterceptor/aidl/default/{nlinterceptor-default.xml => nlinterceptor.xml} (100%) diff --git a/wifi/netlinkinterceptor/aidl/default/Android.bp b/wifi/netlinkinterceptor/aidl/default/Android.bp index 5227e51fac..c3a0c03ce7 100644 --- a/wifi/netlinkinterceptor/aidl/default/Android.bp +++ b/wifi/netlinkinterceptor/aidl/default/Android.bp @@ -25,8 +25,6 @@ package { cc_binary { name: "android.hardware.net.nlinterceptor-service.default", - init_rc: ["nlinterceptor-default.rc"], - vintf_fragments: ["nlinterceptor-default.xml"], vendor: true, relative_install_path: "hw", defaults: ["nlinterceptor@defaults"], @@ -45,4 +43,35 @@ cc_binary { "service.cpp", "util.cpp", ], + installable: false, // installed in APEX +} + +apex { + name: "com.android.hardware.net.nlinterceptor", + 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.net.nlinterceptor-service.default", + ], + prebuilts: [ + "nlinterceptor.rc", + "nlinterceptor.xml", + ], +} + +prebuilt_etc { + name: "nlinterceptor.rc", + src: "nlinterceptor.rc", + installable: false, +} + +prebuilt_etc { + name: "nlinterceptor.xml", + src: "nlinterceptor.xml", + sub_dir: "vintf", + installable: false, } diff --git a/wifi/netlinkinterceptor/aidl/default/apex_file_contexts b/wifi/netlinkinterceptor/aidl/default/apex_file_contexts new file mode 100644 index 0000000000..6ee544c834 --- /dev/null +++ b/wifi/netlinkinterceptor/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\.net\.nlinterceptor-service\.default u:object_r:hal_nlinterceptor_default_exec:s0 diff --git a/wifi/netlinkinterceptor/aidl/default/apex_manifest.json b/wifi/netlinkinterceptor/aidl/default/apex_manifest.json new file mode 100644 index 0000000000..4ffeac50f2 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/apex_manifest.json @@ -0,0 +1,4 @@ +{ + "name": "com.android.hardware.net.nlinterceptor", + "version": 1 +} diff --git a/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc b/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc deleted file mode 100644 index 353cb27cd0..0000000000 --- a/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.rc +++ /dev/null @@ -1,4 +0,0 @@ -service nlinterceptor /vendor/bin/hw/android.hardware.net.nlinterceptor-service.default - class hal - user root - group system inet diff --git a/wifi/netlinkinterceptor/aidl/default/nlinterceptor.rc b/wifi/netlinkinterceptor/aidl/default/nlinterceptor.rc new file mode 100644 index 0000000000..ec9baa9e41 --- /dev/null +++ b/wifi/netlinkinterceptor/aidl/default/nlinterceptor.rc @@ -0,0 +1,4 @@ +service nlinterceptor /apex/com.android.hardware.net.nlinterceptor/bin/hw/android.hardware.net.nlinterceptor-service.default + class hal + user root + group system inet diff --git a/wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.xml b/wifi/netlinkinterceptor/aidl/default/nlinterceptor.xml similarity index 100% rename from wifi/netlinkinterceptor/aidl/default/nlinterceptor-default.xml rename to wifi/netlinkinterceptor/aidl/default/nlinterceptor.xml