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

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

fix start driver for corner cases DO NOT MERGE

- Force a start when in RUN_STATE_STOPPING since there
could have a stop driver in that state
- When a driver started event is received is received
from the supplicant, force a reconnect since we could
have out of an intermediate stop event that would have
forced the run state to STOPPED

Bug: 3087621
Change-Id: I3652747a267a3da8349a9fd5c4065d3837a0c545
parent 692cac9f
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -1285,7 +1285,6 @@ public class WifiStateTracker extends NetworkStateTracker {
                        if (macaddr != null) {
                            mWifiInfo.setMacAddress(macaddr);
                        }
                        if (mRunState == RUN_STATE_STARTING) {
                        mRunState = RUN_STATE_RUNNING;
                        if (!mIsScanOnly) {
                            reconnectCommand();
@@ -1295,7 +1294,6 @@ public class WifiStateTracker extends NetworkStateTracker {
                            scan(true);
                        }
                    }
                    }
                    break;
                case DRIVER_HUNG:
                    Log.e(TAG, "Wifi Driver reports HUNG - reloading.");
@@ -1613,12 +1611,10 @@ public class WifiStateTracker extends NetworkStateTracker {
    }

    public synchronized boolean restart() {
        if (mRunState == RUN_STATE_STOPPED) {
        if (isDriverStopped()) {
            mRunState = RUN_STATE_STARTING;
            resetConnections(true);
            return startDriver();
        } else if (mRunState == RUN_STATE_STOPPING) {
            mRunState = RUN_STATE_STARTING;
        }
        return true;
    }