Tethering: add in-process vs out-of-process flag

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 <maze@google.com>
Change-Id: I8e66806d81893885a5ebe8a6dd4194c5b9dae219
diff --git a/Tethering/apex/Android.bp b/Tethering/apex/Android.bp
index b3cae7c..4a4e6ee 100644
--- a/Tethering/apex/Android.bp
+++ b/Tethering/apex/Android.bp
@@ -18,6 +18,20 @@
     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 @@
     prebuilts: [
         "current_sdkinfo",
         "privapp_allowlist_com.android.tethering",
+        "TetheringOutOfProcessFlag",
     ],
     manifest: "manifest.json",
     key: "com.android.tethering.key",
@@ -187,4 +202,9 @@
         "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 0000000..e69de29
--- /dev/null
+++ b/Tethering/apex/in-process
diff --git a/Tethering/apex/out-of-process b/Tethering/apex/out-of-process
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tethering/apex/out-of-process