From 7a03c187f596049db96acdae3f00dc6ff5e9e672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Thu, 27 Apr 2023 19:22:11 +0000 Subject: [PATCH] remove inprocess tethering It is just a constant source of bugs, with no real tests, let's stop pretending this is a supported configuration. The only tested configuration is out-of-process tethering updatable apex. Test: TreeHugger Bug: 279942846 Change-Id: I4b659a3cd32b89a65549b56006b926a5ac755f7b --- Tethering/Android.bp | 19 -------------- Tethering/AndroidManifest_InProcess.xml | 34 ------------------------- Tethering/apex/Android.bp | 31 ---------------------- bpf_progs/Android.bp | 24 ----------------- bpf_progs/offload.c | 6 ----- bpf_progs/offload@inprocess.c | 1 - bpf_progs/test.c | 6 ----- bpf_progs/test@inprocess.c | 1 - 8 files changed, 122 deletions(-) delete mode 100644 Tethering/AndroidManifest_InProcess.xml delete mode 120000 bpf_progs/offload@inprocess.c delete mode 120000 bpf_progs/test@inprocess.c diff --git a/Tethering/Android.bp b/Tethering/Android.bp index 83ca2b7b0e..b88ec7f1b5 100644 --- a/Tethering/Android.bp +++ b/Tethering/Android.bp @@ -119,7 +119,6 @@ cc_library { name: "libcom_android_networkstack_tethering_util_jni", sdk_version: "30", apex_available: [ - "//apex_available:platform", // Used by InProcessTethering "com.android.tethering", ], min_sdk_version: "30", @@ -188,24 +187,6 @@ java_defaults { lint: { strict_updatability_linting: true }, } -// Non-updatable tethering running in the system server process for devices not using the module -android_app { - name: "InProcessTethering", - defaults: [ - "TetheringAppDefaults", - "TetheringApiLevel", - "ConnectivityNextEnableDefaults", - "TetheringReleaseTargetSdk" - ], - static_libs: ["TetheringApiCurrentLib"], - certificate: "platform", - manifest: "AndroidManifest_InProcess.xml", - // InProcessTethering is a replacement for Tethering - overrides: ["Tethering"], - apex_available: ["com.android.tethering"], - lint: { strict_updatability_linting: true }, -} - // Updatable tethering packaged for finalized API android_app { name: "Tethering", diff --git a/Tethering/AndroidManifest_InProcess.xml b/Tethering/AndroidManifest_InProcess.xml deleted file mode 100644 index b1f124097c..0000000000 --- a/Tethering/AndroidManifest_InProcess.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - diff --git a/Tethering/apex/Android.bp b/Tethering/apex/Android.bp index d84fef3c2d..4506e5ae56 100644 --- a/Tethering/apex/Android.bp +++ b/Tethering/apex/Android.bp @@ -18,13 +18,6 @@ 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", @@ -254,27 +247,3 @@ systemserverclasspath_fragment { standalone_contents: ["service-connectivity"], apex_available: ["com.android.tethering"], } - -override_apex { - name: "com.android.tethering.inprocess", - base: "com.android.tethering", - package_name: "com.android.tethering.inprocess", - enabled: enable_tethering_next_apex, - bpfs: [ - "block.o", - "clatd.o", - "dscpPolicy.o", - "netd.o", - "offload@inprocess.o", - "test@inprocess.o", - ], - apps: [ - "ServiceConnectivityResources", - "InProcessTethering", - ], - prebuilts: [ - "current_sdkinfo", - "privapp_allowlist_com.android.tethering", - "TetheringInProcessFlag", - ], -} diff --git a/bpf_progs/Android.bp b/bpf_progs/Android.bp index 229dce3607..b3f8ed6160 100644 --- a/bpf_progs/Android.bp +++ b/bpf_progs/Android.bp @@ -102,18 +102,6 @@ bpf { ], } -bpf { - name: "offload@inprocess.o", - srcs: ["offload@inprocess.c"], - btf: true, - cflags: [ - "-Wall", - "-Werror", - "-DBTF", - "-DINPROCESS", - ], -} - bpf { name: "test.o", srcs: ["test.c"], @@ -134,18 +122,6 @@ bpf { ], } -bpf { - name: "test@inprocess.o", - srcs: ["test@inprocess.c"], - btf: true, - cflags: [ - "-Wall", - "-Werror", - "-DBTF", - "-DINPROCESS", - ], -} - bpf { name: "clatd.o", srcs: ["clatd.c"], diff --git a/bpf_progs/offload.c b/bpf_progs/offload.c index f4d4254baa..80d1a419d5 100644 --- a/bpf_progs/offload.c +++ b/bpf_progs/offload.c @@ -38,13 +38,7 @@ // Warning: values other than AID_ROOT don't work for map uid on BpfLoader < v0.21 #define TETHERING_UID AID_ROOT -#ifdef INPROCESS -#define DEFAULT_BPF_MAP_SELINUX_CONTEXT "fs_bpf_net_shared" -#define DEFAULT_BPF_PROG_SELINUX_CONTEXT "fs_bpf_net_shared" -#define TETHERING_GID AID_SYSTEM -#else #define TETHERING_GID AID_NETWORK_STACK -#endif #include "bpf_helpers.h" #include "bpf_net_helpers.h" diff --git a/bpf_progs/offload@inprocess.c b/bpf_progs/offload@inprocess.c deleted file mode 120000 index 4092e0da16..0000000000 --- a/bpf_progs/offload@inprocess.c +++ /dev/null @@ -1 +0,0 @@ -offload.c \ No newline at end of file diff --git a/bpf_progs/test.c b/bpf_progs/test.c index d1f780f9d0..091743c5ba 100644 --- a/bpf_progs/test.c +++ b/bpf_progs/test.c @@ -32,13 +32,7 @@ // Warning: values other than AID_ROOT don't work for map uid on BpfLoader < v0.21 #define TETHERING_UID AID_ROOT -#ifdef INPROCESS -#define DEFAULT_BPF_MAP_SELINUX_CONTEXT "fs_bpf_net_shared" -#define DEFAULT_BPF_PROG_SELINUX_CONTEXT "fs_bpf_net_shared" -#define TETHERING_GID AID_SYSTEM -#else #define TETHERING_GID AID_NETWORK_STACK -#endif // This is non production code, only used for testing // Needed because the bitmap array definition is non-kosher for pre-T OS devices. diff --git a/bpf_progs/test@inprocess.c b/bpf_progs/test@inprocess.c deleted file mode 120000 index aeebb2626a..0000000000 --- a/bpf_progs/test@inprocess.c +++ /dev/null @@ -1 +0,0 @@ -test.c \ No newline at end of file