summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Plass <mplass@google.com>2019-08-08 15:18:20 -0700
committerMichael Plass <mplass@google.com>2019-08-08 16:42:46 -0700
commit67dd4887b653325358531bb136133a3e5cf641f1 (patch)
tree20e641aaa6b94217805d6412efeb598aecf60f17 /tests
parent9df3b4c8dd492a6b76fe76059e452bd8cec64b33 (diff)
Avoid spurious mode changes in ActiveModeWarden
When ActiveModeWarden is asked to enter a mode that it is already in, don't transition out of the mode and back into it, because that can cause wifi to disconnect for no good reason. Bug: 138242465 Test: atest FrameworksWifiTests Test: Manual test entering and leaving emergency callback mode Change-Id: Ic13853172ad58dffd9055b5b14b438bf112001f1
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/ActiveModeWardenTest.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ActiveModeWardenTest.java b/tests/wifitests/src/com/android/server/wifi/ActiveModeWardenTest.java
index f52229c1d..df7b148c7 100644
--- a/tests/wifitests/src/com/android/server/wifi/ActiveModeWardenTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/ActiveModeWardenTest.java
@@ -311,8 +311,8 @@ public class ActiveModeWardenTest {
}
/**
- * Thest that we can switch from ScanOnlyActiveMode to another mode.
- * Expectation: When switching out of ScanOlyModeActivState we stop the ScanOnlyModeManager.
+ * Test that we can switch from ScanOnlyActiveMode to another mode.
+ * Expectation: When switching out of ScanOnlyModeActivState we stop the ScanOnlyModeManager.
*/
@Test
public void testSwitchModeWhenScanOnlyModeActiveState() throws Exception {
@@ -326,6 +326,18 @@ public class ActiveModeWardenTest {
}
/**
+ * Reentering ClientModeActiveState should be a NOP.
+ */
+ @Test
+ public void testReenterClientModeActiveStateIsNop() throws Exception {
+ enterClientModeActiveState();
+ reset(mClientModeManager);
+ mActiveModeWarden.enterClientMode();
+ mLooper.dispatchAll();
+ verify(mClientModeManager, never()).start();
+ }
+
+ /**
* Test that we can switch from SoftApActiveMode to another mode.
* Expectation: When switching out of SoftApModeActiveState we do not impact softap operation
*/