Merge "Ensure airplane mode take effect by checking softap status" am: 1860b17def

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2510558

Change-Id: Ic9ee6f54a68cb6120a1019f9ab95bc7174fc5bba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Mark Chien
2023-04-06 07:23:01 +00:00
committed by Automerger Merge Worker

View File

@@ -2556,15 +2556,14 @@ public class ConnectivityManagerTest {
try {
tetherEventCallback.assumeWifiTetheringSupported(mContext);
final TestableNetworkCallback wifiCb = new TestableNetworkCallback();
mCtsNetUtils.ensureWifiConnected();
registerCallbackAndWaitForAvailable(makeWifiNetworkRequest(), wifiCb);
tetherUtils.startWifiTethering(tetherEventCallback);
// Update setting to verify the behavior.
setAirplaneMode(true);
// Verify wifi lost to make sure airplane mode takes effect. This could
// Verify softap lost to make sure airplane mode takes effect. This could
// prevent the race condition between airplane mode enabled and the followed
// up wifi tethering enabled.
waitForLost(wifiCb);
tetherEventCallback.expectNoTetheringActive();
// start wifi tethering
tetherUtils.startWifiTethering(tetherEventCallback);