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

Commit 88d765a0 authored by Paul Zhang's avatar Paul Zhang Committed by Gerrit - the friendly Code Review server
Browse files

WIFI: Fix wifi auto-connect to other saved APs during WPS PIN scanning.

During WPS PIN scanning and AP side not enter the PIN, continuously
turn off/on screen will sometimes cause the phone auto-connect to
other saved APs.

WifiStateMachine accepts screenOn event, and sometimes will enable
all networks.

This change will NOT enable all networks in screenOn event While wps
is running.

Change-Id: I539ee6020a8e2b2fa6892c88569c302f89e8f5ed
CRs-Fixed: 646433
parent 70302163
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1669,7 +1669,12 @@ public class WifiStateMachine extends StateMachine {
            enableBackgroundScanCommand(screenOn == false);
        }

        if (screenOn) enableAllNetworks();
        // While wps is running, DO NOT enabled all networks
        // to prevent auto-connect to other APs.
        if (screenOn && (getCurrentState() != mWpsRunningState)) {
            enableAllNetworks();
        }

        if (mUserWantsSuspendOpt.get()) {
            if (screenOn) {
                sendMessage(CMD_SET_SUSPEND_OPT_ENABLED, 0, 0);