summaryrefslogtreecommitdiff
path: root/service
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 /service
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 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiServiceImpl.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/WifiServiceImpl.java b/service/java/com/android/server/wifi/WifiServiceImpl.java
index eb1746e87..c2913ea73 100644
--- a/service/java/com/android/server/wifi/WifiServiceImpl.java
+++ b/service/java/com/android/server/wifi/WifiServiceImpl.java
@@ -966,10 +966,17 @@ public class WifiServiceImpl extends IWifiManager.Stub {
LocalOnlyHotspotCallback.ERROR_INCOMPATIBLE_MODE);
break;
case WifiManager.IFACE_IP_MODE_CONFIGURATION_ERROR:
- // there was an error setting up the hotspot... trigger onFailed for the
- // registered LOHS requestors
- sendHotspotFailedMessageToAllLOHSRequestInfoEntriesLocked(
- LocalOnlyHotspotCallback.ERROR_GENERIC);
+ Slog.d(TAG, "IP mode config error - need to clean up");
+ if (mLocalOnlyHotspotRequests.isEmpty()) {
+ Slog.d(TAG, "no LOHS requests, stop softap");
+ stopSoftAp();
+ } else {
+ Slog.d(TAG, "we have LOHS requests, clean them up");
+ // there was an error setting up the hotspot... trigger onFailed for the
+ // registered LOHS requestors
+ sendHotspotFailedMessageToAllLOHSRequestInfoEntriesLocked(
+ LocalOnlyHotspotCallback.ERROR_GENERIC);
+ }
updateInterfaceIpStateInternal(null, WifiManager.IFACE_IP_MODE_UNSPECIFIED);
break;
case WifiManager.IFACE_IP_MODE_UNSPECIFIED: