From dafb9f257b9b42d62808d8ad9408804e18bbf8b3 Mon Sep 17 00:00:00 2001 From: Motomu Utsumi Date: Wed, 16 Aug 2023 20:05:36 +0900 Subject: [PATCH 1/2] Rename to isTetheringFeatureNotChickenedOut Original name was isTetheringFeatureForceDisabled but it's expected that the caller of this method will use as `enabled = !isTetheringFeatureForceDisabled` which is error prune. So aosp/2711138 renames to isTetheringFeatureNotChickenedOut and updates to return true if the feature is not disabled. Bug: 279108992 Test: m Change-Id: Ia992113e9fb1aee09fcfe48e2b39ca03876063ee --- .../src/com/android/server/connectivity/KeepaliveTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/service/src/com/android/server/connectivity/KeepaliveTracker.java b/service/src/com/android/server/connectivity/KeepaliveTracker.java index ae7076768e..feba82198d 100644 --- a/service/src/com/android/server/connectivity/KeepaliveTracker.java +++ b/service/src/com/android/server/connectivity/KeepaliveTracker.java @@ -993,7 +993,7 @@ public class KeepaliveTracker { */ public boolean isAddressTranslationEnabled(@NonNull Context context) { return DeviceConfigUtils.isFeatureSupported(context, FEATURE_CLAT_ADDRESS_TRANSLATE) - && !DeviceConfigUtils.isTetheringFeatureForceDisabled( + && DeviceConfigUtils.isTetheringFeatureNotChickenedOut( CONFIG_DISABLE_CLAT_ADDRESS_TRANSLATE); } } From 7628ea30b087e67d2e1e978776625e078281319e Mon Sep 17 00:00:00 2001 From: Motomu Utsumi Date: Mon, 14 Aug 2023 11:09:02 +0900 Subject: [PATCH 2/2] Use Java code path for bpf map operations in BpfNetMaps Experiment to verify bpf map operations refactoring showed no change of map size metrics and no system health regressions. So this CL update BpfNetMaps to always use new code path with kill switch. Test: m Bug: 217624062 Change-Id: Ic17470ac5c075884871ea2df2c13c054f5ac2929 --- service/src/com/android/server/BpfNetMaps.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/service/src/com/android/server/BpfNetMaps.java b/service/src/com/android/server/BpfNetMaps.java index f08ffc320c..2842cc3963 100644 --- a/service/src/com/android/server/BpfNetMaps.java +++ b/service/src/com/android/server/BpfNetMaps.java @@ -43,7 +43,6 @@ import android.net.INetd; import android.os.Build; import android.os.RemoteException; import android.os.ServiceSpecificException; -import android.provider.DeviceConfig; import android.system.ErrnoException; import android.system.Os; import android.util.ArraySet; @@ -95,8 +94,8 @@ public class BpfNetMaps { private static boolean sInitialized = false; private static Boolean sEnableJavaBpfMap = null; - private static final String BPF_NET_MAPS_ENABLE_JAVA_BPF_MAP = - "bpf_net_maps_enable_java_bpf_map"; + private static final String BPF_NET_MAPS_FORCE_DISABLE_JAVA_BPF_MAP = + "bpf_net_maps_force_disable_java_bpf_map"; // Lock for sConfigurationMap entry for UID_RULES_CONFIGURATION_KEY. // This entry is not accessed by others. @@ -283,9 +282,8 @@ public class BpfNetMaps { if (sInitialized) return; if (sEnableJavaBpfMap == null) { sEnableJavaBpfMap = SdkLevel.isAtLeastU() || - DeviceConfigUtils.isFeatureEnabled(context, - DeviceConfig.NAMESPACE_TETHERING, BPF_NET_MAPS_ENABLE_JAVA_BPF_MAP, - DeviceConfigUtils.TETHERING_MODULE_NAME, false /* defaultValue */); + DeviceConfigUtils.isTetheringFeatureNotChickenedOut( + BPF_NET_MAPS_FORCE_DISABLE_JAVA_BPF_MAP); } Log.d(TAG, "BpfNetMaps is initialized with sEnableJavaBpfMap=" + sEnableJavaBpfMap);