@@ -1771,15 +1771,18 @@ void handlePreDhcpSetup() {
17711771 }
17721772
17731773 /* Disable power save and suspend optimizations during DHCP */
1774- mWifiNative .setPowerSave (false );
1774+ // Note: The order here is important for now. Brcm driver changes
1775+ // power settings when we control suspend mode optimizations.
1776+ // TODO: Remove this comment when the driver is fixed.
17751777 setSuspendOptimizationsNative (SUSPEND_DUE_TO_DHCP , false );
1778+ mWifiNative .setPowerSave (false );
17761779 }
17771780
17781781
17791782 void handlePostDhcpSetup () {
17801783 /* Restore power save and suspend optimizations */
1781- mWifiNative .setPowerSave (true );
17821784 setSuspendOptimizationsNative (SUSPEND_DUE_TO_DHCP , true );
1785+ mWifiNative .setPowerSave (true );
17831786
17841787 // Set the coexistence mode back to its default value
17851788 mWifiNative .setBluetoothCoexistenceMode (
@@ -2710,8 +2713,6 @@ public void enter() {
27102713 mWifiNative .stopFilteringMulticastV4Packets ();
27112714 }
27122715
2713- mWifiNative .setPowerSave (true );
2714-
27152716 if (mIsScanMode ) {
27162717 mWifiNative .setScanResultHandling (SCAN_ONLY_MODE );
27172718 mWifiNative .disconnect ();
@@ -2736,6 +2737,7 @@ public void enter() {
27362737 mWifiNative .setSuspendOptimizations (mSuspendOptNeedsDisabled == 0
27372738 && mUserWantsSuspendOpt .get ());
27382739 }
2740+ mWifiNative .setPowerSave (true );
27392741
27402742 if (mP2pSupported ) mWifiP2pChannel .sendMessage (WifiStateMachine .CMD_ENABLE_P2P );
27412743 }
0 commit comments