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

Commit cc5dd18d authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Change order of ps and suspendmode calls" into jb-mr1-dev

parents c71a57d6 9da603c2
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1771,15 +1771,18 @@ public class WifiStateMachine extends StateMachine {
        }

        /* Disable power save and suspend optimizations during DHCP */
        mWifiNative.setPowerSave(false);
        // Note: The order here is important for now. Brcm driver changes
        // power settings when we control suspend mode optimizations.
        // TODO: Remove this comment when the driver is fixed.
        setSuspendOptimizationsNative(SUSPEND_DUE_TO_DHCP, false);
        mWifiNative.setPowerSave(false);
    }


    void handlePostDhcpSetup() {
        /* Restore power save and suspend optimizations */
        mWifiNative.setPowerSave(true);
        setSuspendOptimizationsNative(SUSPEND_DUE_TO_DHCP, true);
        mWifiNative.setPowerSave(true);

        // Set the coexistence mode back to its default value
        mWifiNative.setBluetoothCoexistenceMode(
@@ -2710,8 +2713,6 @@ public class WifiStateMachine extends StateMachine {
                mWifiNative.stopFilteringMulticastV4Packets();
            }

            mWifiNative.setPowerSave(true);

            if (mIsScanMode) {
                mWifiNative.setScanResultHandling(SCAN_ONLY_MODE);
                mWifiNative.disconnect();
@@ -2736,6 +2737,7 @@ public class WifiStateMachine extends StateMachine {
                mWifiNative.setSuspendOptimizations(mSuspendOptNeedsDisabled == 0
                        && mUserWantsSuspendOpt.get());
            }
            mWifiNative.setPowerSave(true);

            if (mP2pSupported) mWifiP2pChannel.sendMessage(WifiStateMachine.CMD_ENABLE_P2P);
        }