summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2018-05-09 21:59:47 -0700
committerRebecca Silberstein <silberst@google.com>2018-05-09 21:59:47 -0700
commitab00689b004ddb2594492d50406fb61a3f1bf8b9 (patch)
tree194abc04b88c326dac472fc2cab6d4933dfb9434 /tests
parent43b4bb291800401b67daf50156f8d04c64569c21 (diff)
WifiServiceImpl: stop softap when ip config fails
When IP Configuration fails for LOHS or tethering, make sure we clean up. (LOHS was cleaned up, but now also handle tethering mode.) Shutting down softap mode for tethering avoids leaving the user in an unworkable state where the wifi hotspot is up, but clients can't successfully connect. Bug: 79438789 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: manually verified without fixes for b/79400794 Change-Id: Ia0a821262bdec0066c50b36694c5ed5cbfa0f82f
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
index 46b29a46b..102ebca15 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
@@ -2013,6 +2013,8 @@ public class WifiServiceImplTest {
assertEquals(HOTSPOT_FAILED, message.what);
assertEquals(ERROR_GENERIC, message.arg1);
+ verify(mWifiController, never()).sendMessage(eq(CMD_SET_AP), eq(0), eq(0));
+
// sendMessage should only happen once since the requestor should be unregistered
reset(mHandler);
@@ -2024,6 +2026,18 @@ public class WifiServiceImplTest {
}
/**
+ * Verify that softap mode is stopped for tethering if we receive an update with an ip mode
+ * configuration error.
+ */
+ @Test
+ public void testStopSoftApWhenIpConfigFails() throws Exception {
+ mWifiServiceImpl.updateInterfaceIpState(WIFI_IFACE_NAME, IFACE_IP_MODE_CONFIGURATION_ERROR);
+ mLooper.dispatchAll();
+
+ verify(mWifiController).sendMessage(eq(CMD_SET_AP), eq(0), eq(0));
+ }
+
+ /**
* Verify that if a LOHS request is active and tethering starts, callers are notified on the
* incompatible mode and are unregistered.
*/