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

Commit ccceceaa authored by Hanumantha Reddy Pothula's avatar Hanumantha Reddy Pothula Committed by Steve Kondik
Browse files

wlan: Modify sequence of events sent during DHCP phase.

Modify sequence of events sent to driver during DHCP phase, to
make sure WLAN can enter into power save only after DHCP is done.

Change-Id: Idf7ed8d6e1c011bd3b7af9f5ca9d4db46de55fb0
CRs-Fixed: 719573
parent 68980c4d
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -2374,9 +2374,6 @@ public class WifiStateMachine extends StateMachine {

    void handlePreDhcpSetup() {
        mDhcpActive = true;
            // Disable the coexistence mode
            mWifiNative.setBluetoothCoexistenceMode(
                    mWifiNative.BLUETOOTH_COEXISTENCE_MODE_DISABLED);

        /* Disable power save and suspend optimizations during DHCP */
        // Note: The order here is important for now. Brcm driver changes
@@ -2385,6 +2382,10 @@ public class WifiStateMachine extends StateMachine {
        setSuspendOptimizationsNative(SUSPEND_DUE_TO_DHCP, false);
        mWifiNative.setPowerSave(false);

        // Disable the coexistence mode
        mWifiNative.setBluetoothCoexistenceMode(
                    mWifiNative.BLUETOOTH_COEXISTENCE_MODE_DISABLED);

        stopBatchedScan();

        /* P2p discovery breaks dhcp, shut it down in order to get through this */
@@ -2416,16 +2417,16 @@ public class WifiStateMachine extends StateMachine {
    }

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

        mWifiP2pChannel.sendMessage(WifiP2pService.BLOCK_DISCOVERY, WifiP2pService.DISABLED);

        // Set the coexistence mode back to its default value
        mWifiNative.setBluetoothCoexistenceMode(
                mWifiNative.BLUETOOTH_COEXISTENCE_MODE_SENSE);

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

        mDhcpActive = false;

        startBatchedScan();