diff --git a/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java b/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java index b3e9c1be9d..85036c2bac 100644 --- a/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java +++ b/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java @@ -142,7 +142,7 @@ public class TetheringConfiguration { public static final int DEFAULT_TETHER_OFFLOAD_POLL_INTERVAL_MS = 5000; /** A flag for using synchronous or asynchronous state machine. */ - public static boolean USE_SYNC_SM = false; + public static boolean USE_SYNC_SM = true; /** * A feature flag to control whether the active sessions metrics should be enabled. @@ -195,6 +195,10 @@ public class TetheringConfiguration { return DeviceConfigUtils.isTetheringFeatureEnabled(context, name); } + boolean isFeatureNotChickenedOut(@NonNull Context context, @NonNull String name) { + return DeviceConfigUtils.isTetheringFeatureNotChickenedOut(context, name); + } + boolean getDeviceConfigBoolean(@NonNull String namespace, @NonNull String name, boolean defaultValue) { return DeviceConfig.getBoolean(namespace, name, defaultValue); @@ -394,7 +398,7 @@ public class TetheringConfiguration { * use the async state machine. */ public void readEnableSyncSM(final Context ctx) { - USE_SYNC_SM = mDeps.isFeatureEnabled(ctx, TETHER_ENABLE_SYNC_SM); + USE_SYNC_SM = mDeps.isFeatureNotChickenedOut(ctx, TETHER_ENABLE_SYNC_SM); } /** Does the dumping.*/ diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/FakeTetheringConfiguration.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/FakeTetheringConfiguration.java index 087be2678f..c97fa3db27 100644 --- a/Tethering/tests/unit/src/com/android/networkstack/tethering/FakeTetheringConfiguration.java +++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/FakeTetheringConfiguration.java @@ -32,6 +32,11 @@ public class FakeTetheringConfiguration extends TetheringConfiguration { return false; } + @Override + boolean isFeatureNotChickenedOut(@NonNull Context context, @NonNull String name) { + return true; + } + @Override boolean getDeviceConfigBoolean(@NonNull String namespace, @NonNull String name, boolean defaultValue) { diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java index dd51c7ad1d..0159573acf 100644 --- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java +++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java @@ -159,6 +159,11 @@ public class TetheringConfigurationTest { return isMockFlagEnabled(name, false /* defaultEnabled */); } + @Override + boolean isFeatureNotChickenedOut(@NonNull Context context, @NonNull String name) { + return isMockFlagEnabled(name, true /* defaultEnabled */); + } + @Override boolean getDeviceConfigBoolean(@NonNull String namespace, @NonNull String name, boolean defaultValue) { @@ -767,9 +772,9 @@ public class TetheringConfigurationTest { @Test public void testEnableSyncSMFlag() throws Exception { - // Test default disabled + // Test default enabled setTetherEnableSyncSMFlagEnabled(null); - assertEnableSyncSM(false); + assertEnableSyncSM(true); setTetherEnableSyncSMFlagEnabled(true); assertEnableSyncSM(true);