From a3ef48117f1892c7d3674e5a26e87fe16f3f9cba Mon Sep 17 00:00:00 2001 From: markchien Date: Fri, 14 May 2021 16:56:33 +0800 Subject: [PATCH] Check whether feature is enabled by compare with apex version Replace the isFeatureEnabled function which is check with apex version. Bug: 187946226 Test: Set device config flag and check the result Change-Id: Iba44a01e2fdd0698dcb338ea4a8fe8147cbaa7dd --- .../networkstack/tethering/TetheringConfiguration.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java b/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java index 413b0cb6bc..2beeeb8bca 100644 --- a/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java +++ b/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java @@ -58,6 +58,8 @@ public class TetheringConfiguration { private static final String[] EMPTY_STRING_ARRAY = new String[0]; + private static final String TETHERING_MODULE_NAME = "com.android.tethering"; + // Default ranges used for the legacy DHCP server. // USB is 192.168.42.1 and 255.255.255.0 // Wifi is 192.168.43.1 and 255.255.255.0 @@ -473,7 +475,8 @@ public class TetheringConfiguration { @VisibleForTesting protected boolean isFeatureEnabled(Context ctx, String featureVersionFlag) { - return DeviceConfigUtils.isFeatureEnabled(ctx, NAMESPACE_CONNECTIVITY, featureVersionFlag); + return DeviceConfigUtils.isFeatureEnabled(ctx, NAMESPACE_CONNECTIVITY, featureVersionFlag, + TETHERING_MODULE_NAME, false /* defaultEnabled */); } private Resources getResources(Context ctx, int subId) {