summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorPaul Stewart <pstew@google.com>2016-03-09 14:53:06 -0800
committerPaul Stewart <pstew@google.com>2016-03-09 15:00:25 -0800
commitfc0f43edd0def7d760e42d6e800d862007cf9fd5 (patch)
tree867534c9a7ebc822f18025e7c755d8d5affc0b84 /service
parente5da466fd5d9d8024780590ee8b1c335889443a7 (diff)
WifiStateMachine: Return to InitialState if driver start fails
If WiFi is set to shut off on idle, WifiController calls mWifiStateMachine.setDriverStart(false), and WifiStateMachine eventually enters the DriverStopped state. On return from idle the reverse happens and WifiStateMachine attempts to restore the driver. If this fails, WifiStateMachine simply returns to the DriverStopped state. This CL changes this behavior. If restarting the driver fails we now restart supplicant, which causes the state machine to traverse the InitialState. This provides a fail safe mechanism for restarting drivers that may not have suspended correctly. Bug: 26735919 Change-Id: Ide9bc5339a9be1ea4ac67fc99fe6065529ee67e2 Test: Reproduce b/26735919 on bullhead, which is currently suffering from b/27576943
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index 9519d80ca..0cbb3ff1f 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -5516,7 +5516,8 @@ public class WifiStateMachine extends StateMachine implements WifiNative.PnoEven
if (message.arg1 == mDriverStartToken) {
if (mTries >= 2) {
loge("Failed to start driver after " + mTries);
- transitionTo(mDriverStoppedState);
+ setSupplicantRunning(false);
+ setSupplicantRunning(true);
} else {
loge("Driver start failed, retrying");
mWakeLock.acquire();