From 760d1ed08a9a6605c5f23f3b494d5df11450241a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Fri, 8 Jul 2022 05:57:10 -0700 Subject: [PATCH] Tethering: add in-process vs out-of-process flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change results in the existence of either: /apex/com.android.tethering/etc/flag/out-of-process (Phones with mainline updatable Tethering in network_stack process) or /apex/com.android.tethering/etc/flag/in-process (Android Go with InProcessTethering in system_server process) These flags provide an easy way for the BpfLoader to detect the required selinux context for /sys/fs/bpf/tethering directory. Bug: 190523685 Bug: 236925089 Signed-off-by: Maciej Żenczykowski Change-Id: I8e66806d81893885a5ebe8a6dd4194c5b9dae219 --- Tethering/apex/Android.bp | 20 ++++++++++++++++++++ Tethering/apex/in-process | 0 Tethering/apex/out-of-process | 0 3 files changed, 20 insertions(+) create mode 100644 Tethering/apex/in-process create mode 100644 Tethering/apex/out-of-process diff --git a/Tethering/apex/Android.bp b/Tethering/apex/Android.bp index b3cae7cd73..4a4e6eee10 100644 --- a/Tethering/apex/Android.bp +++ b/Tethering/apex/Android.bp @@ -18,6 +18,20 @@ package { default_applicable_licenses: ["Android-Apache-2.0"], } +prebuilt_etc { + name: "TetheringInProcessFlag", + src: "in-process", + filename_from_src: true, + sub_dir: "flag", +} + +prebuilt_etc { + name: "TetheringOutOfProcessFlag", + src: "out-of-process", + filename_from_src: true, + sub_dir: "flag", +} + // Defaults to enable/disable java targets which uses development APIs. "enabled" may have a // different value depending on the branch. java_defaults { @@ -82,6 +96,7 @@ apex { prebuilts: [ "current_sdkinfo", "privapp_allowlist_com.android.tethering", + "TetheringOutOfProcessFlag", ], manifest: "manifest.json", key: "com.android.tethering.key", @@ -187,4 +202,9 @@ override_apex { "ServiceConnectivityResources", "InProcessTethering", ], + prebuilts: [ + "current_sdkinfo", + "privapp_allowlist_com.android.tethering", + "TetheringInProcessFlag", + ], } diff --git a/Tethering/apex/in-process b/Tethering/apex/in-process new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Tethering/apex/out-of-process b/Tethering/apex/out-of-process new file mode 100644 index 0000000000..e69de29bb2