summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2018-07-30 13:19:50 -0700
committerRoshan Pius <rpius@google.com>2018-07-30 14:05:57 -0700
commitc85e8813b449fc339c9bf775de044ce78190c908 (patch)
treea5d2f0bd3f53e023f38b5ac940fb8992eb35d392 /tests
parent77021f9c7b1f80ccf288ca60fbf8296a36d25039 (diff)
WifiController: Enable softap toggle in airplane mode
Wifi tethering should work even in airplane mode. So, remove the restriction in WifiController which prevents enabling SoftAp in airplane mode. There is no FCC or carrier requirements to disable SoftAp in airplane mode. LTE tethering would obviously disabled because the mobile radio is off in airplane mode. Note: We need some UI changes for this to be available to the users (details mentioned in the associated bug). Bug: 111681176 Test: Unit tests Test: Added a new ACTS test which toggle softap state after turning on airplane mode. Change-Id: Ie67b1de1d31615a75683c1e91290e647eaae809c
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java
index f40875624..f07a256a4 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java
@@ -829,6 +829,25 @@ public class WifiControllerTest {
}
/**
+ * Toggling softap mode when in airplane mode needs to enable softap
+ */
+ @Test
+ public void testSoftApModeToggleWhenInAirplaneMode() throws Exception {
+ // Test with airplane mode turned on:
+ when(mSettingsStore.isAirplaneModeOn()).thenReturn(true);
+
+ // Turn on SoftAp.
+ mWifiController.sendMessage(CMD_SET_AP, 1);
+ mLooper.dispatchAll();
+ verify(mActiveModeWarden).enterSoftAPMode(any());
+
+ // Turn off SoftAp.
+ mWifiController.sendMessage(CMD_SET_AP, 0);
+ mLooper.dispatchAll();
+ verify(mActiveModeWarden).stopSoftAPMode();
+ }
+
+ /**
* Toggling off scan mode when in ECM does not induce a mode change
*/
@Test
@@ -850,6 +869,7 @@ public class WifiControllerTest {
verifyNoMoreInteractions(mActiveModeWarden);
}
+
/**
* Toggling off client mode when in ECM does not induce a mode change
*/