Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2a10785 authored by Irfan Sheriff's avatar Irfan Sheriff
Browse files

Disconnect without CTRL-EVENT-DISCONNECTED

Handle a supplicant state change indicating disconnection
even if we have missed the CTRL-EVENT-DISCONNECTED notice

Bug: 5437924
Change-Id: I28e314f47f17359926c091b2015cd1fb7422fb22
parent 63fae9d5
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2698,6 +2698,19 @@ public class WifiStateMachine extends StateMachine {
                            handleNetworkDisconnect();
                        }
                        transitionTo(mDriverStoppedState);
                        break;
                    }

                    // Supplicant can fail to report a NETWORK_DISCONNECTION_EVENT
                    // when authentication times out after a successful connection,
                    // we can figure this from the supplicant state. If supplicant
                    // state is DISCONNECTED, but the mNetworkInfo says we are not
                    // disconnected, we need to handle a disconnection
                    if (state == SupplicantState.DISCONNECTED &&
                            mNetworkInfo.getState() != NetworkInfo.State.DISCONNECTED) {
                        if (DBG) log("Missed CTRL-EVENT-DISCONNECTED, disconnect");
                        handleNetworkDisconnect();
                        transitionTo(mDisconnectedState);
                    }
                    break;
                    /* Do a redundant disconnect without transition */