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

Commit 3117366d authored by Mahesh A Saptasagar's avatar Mahesh A Saptasagar Committed by Steve Kondik
Browse files

wlan: Error handling on PNO failure due to active P2P session.

If set PNO fails due to concurrent active p2p sessions,
handle the error condition in framework and issue a
regular scan for every framework background scan interval
until set PNO is either success or disabled.

Change-Id: Ia4e8d9aef9ed24e534cb57cea7c8ba7a7ffc509e
CRs-Fixed: 568458
parent 529747a8
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -470,11 +470,13 @@ public class WifiNative {
        return doBooleanCommand("DRIVER COUNTRY " + countryCode.toUpperCase(Locale.ROOT));
    }

    public void enableBackgroundScan(boolean enable) {
    public boolean enableBackgroundScan(boolean enable) {
        if (enable) {
            doBooleanCommand("SET pno 1");
            Log.e(mTAG, "doBoolean: enable");
            return doBooleanCommand("SET pno 1");
        } else {
            doBooleanCommand("SET pno 0");
            Log.e(mTAG, "doBoolean: disable");
            return doBooleanCommand("SET pno 0");
        }
    }

+15 −4
Original line number Diff line number Diff line
@@ -4016,7 +4016,11 @@ public class WifiStateMachine extends StateMachine {
                 * cleared
                 */
                if (!mScanResultIsPending) {
                    mWifiNative.enableBackgroundScan(true);
                    if (!mWifiNative.enableBackgroundScan(true)) {
                        setScanAlarm(true);
                    } else {
                        setScanAlarm(false);
                    }
                }
            } else {
                setScanAlarm(true);
@@ -4070,8 +4074,11 @@ public class WifiStateMachine extends StateMachine {
                case CMD_ENABLE_BACKGROUND_SCAN:
                    mEnableBackgroundScan = (message.arg1 == 1);
                    if (mEnableBackgroundScan) {
                        mWifiNative.enableBackgroundScan(true);
                        if (!mWifiNative.enableBackgroundScan(true)) {
                            setScanAlarm(true);
                        } else {
                            setScanAlarm(false);
                        }
                    } else {
                        mWifiNative.enableBackgroundScan(false);
                        setScanAlarm(true);
@@ -4097,7 +4104,11 @@ public class WifiStateMachine extends StateMachine {
                case WifiMonitor.SCAN_RESULTS_EVENT:
                    /* Re-enable background scan when a pending scan result is received */
                    if (mEnableBackgroundScan && mScanResultIsPending) {
                        mWifiNative.enableBackgroundScan(true);
                        if (!mWifiNative.enableBackgroundScan(true)) {
                            setScanAlarm(true);
                        } else {
                            setScanAlarm(false);
                        }
                    }
                    /* Handled in parent state */
                    ret = NOT_HANDLED;