Force TETHER_ENABLE_SYNC_SM to be enabled by default on 25Q2+
Test: atest TetheringTests CtsTetheringTest Change-Id: Id63b4535aaebe90d5fa663ad4584cfd987c3b06b
This commit is contained in:
parent
520093b251
commit
133d806627
3 changed files with 16 additions and 3 deletions
|
|
@ -24,6 +24,7 @@ import static android.net.ConnectivityManager.TYPE_MOBILE_HIPRI;
|
|||
import static android.provider.DeviceConfig.NAMESPACE_CONNECTIVITY;
|
||||
|
||||
import static com.android.networkstack.apishim.ConstantsShim.KEY_CARRIER_SUPPORTS_TETHERING_BOOL;
|
||||
import static com.android.net.module.util.SdkUtil.isAtLeast25Q2;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.Context;
|
||||
|
|
@ -395,7 +396,7 @@ public class TetheringConfiguration {
|
|||
* use the async state machine.
|
||||
*/
|
||||
public void readEnableSyncSM(final Context ctx) {
|
||||
USE_SYNC_SM = mDeps.isFeatureNotChickenedOut(ctx, TETHER_ENABLE_SYNC_SM);
|
||||
USE_SYNC_SM = isAtLeast25Q2() || mDeps.isFeatureNotChickenedOut(ctx, TETHER_ENABLE_SYNC_SM);
|
||||
}
|
||||
|
||||
/** Does the dumping.*/
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ import com.android.internal.util.test.BroadcastInterceptingContext;
|
|||
import com.android.internal.util.test.FakeSettingsProvider;
|
||||
import com.android.modules.utils.build.SdkLevel;
|
||||
import com.android.net.module.util.DeviceConfigUtils;
|
||||
import com.android.net.module.util.SdkUtil;
|
||||
import com.android.net.module.util.SharedLog;
|
||||
import com.android.testutils.DevSdkIgnoreRule;
|
||||
import com.android.testutils.DevSdkIgnoreRule.IgnoreAfter;
|
||||
|
|
@ -779,7 +780,10 @@ public class TetheringConfigurationTest {
|
|||
setTetherEnableSyncSMFlagEnabled(true);
|
||||
assertEnableSyncSM(true);
|
||||
|
||||
setTetherEnableSyncSMFlagEnabled(false);
|
||||
assertEnableSyncSM(false);
|
||||
// Feature is enabled by default after 25Q2 release.
|
||||
if (!SdkUtil.isAtLeast25Q2()) {
|
||||
setTetherEnableSyncSMFlagEnabled(false);
|
||||
assertEnableSyncSM(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@
|
|||
|
||||
package com.android.net.module.util;
|
||||
|
||||
import static android.os.Build.VERSION.SDK_INT;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.os.Build;
|
||||
|
||||
/**
|
||||
* Utilities to deal with multiple SDKs in a single mainline module.
|
||||
|
|
@ -46,4 +49,9 @@ public class SdkUtil {
|
|||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks if the device is running on a release version of Android Baklava or newer */
|
||||
public static boolean isAtLeast25Q2() {
|
||||
return SDK_INT >= 36 || (SDK_INT == 35 && "Baklava".equals(Build.VERSION.CODENAME));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue