Skip to content

Commit 2d57d86

Browse files
committed
Fix handling in DisconnectingState
Now that we also handle supplicant state change to identify that a network is disconnected (in case CTRL-EVENT-DISCONNECTED goes missing), it is dangerous to defer all supplicant state change messages while in DisconnectingState. It may happen that the CTRL-EVENT-DISCONNECTED goes missing while in DisconnectingState resulting in a supplicant state change of 0 (disconnect) getting deferred. Eventually after a connection completes, the supplicant state change events get handled and the state machine goes into DisconnectedState. Fix by having state machine switch out of DisconnectingState once we do not immediately see a CTRL-EVENT-DISCONNECTED state. Bug: 5490789 Change-Id: Ia2263795e53c51da0a2bfeefecfeb6256d6c5267
1 parent 7ec4284 commit 2d57d86

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wifi/java/android/net/wifi/WifiStateMachine.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3043,9 +3043,14 @@ public boolean processMessage(Message message) {
30433043
deferMessage(message);
30443044
}
30453045
break;
3046-
/* Handle in DisconnectedState */
30473046
case WifiMonitor.SUPPLICANT_STATE_CHANGE_EVENT:
3047+
/* If we get a SUPPLICANT_STATE_CHANGE_EVENT before NETWORK_DISCONNECTION_EVENT
3048+
* we have missed the network disconnection, transition to mDisconnectedState
3049+
* and handle the rest of the events there
3050+
*/
30483051
deferMessage(message);
3052+
handleNetworkDisconnect();
3053+
transitionTo(mDisconnectedState);
30493054
break;
30503055
default:
30513056
return NOT_HANDLED;

0 commit comments

Comments
 (0)