Skip to content

Commit 9da603c

Browse files
committed
Change order of ps and suspendmode calls
Change-Id: I7872dbea7dc30c57960af95e86eb8e4c7f8e92dc
1 parent 3d33a63 commit 9da603c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

wifi/java/android/net/wifi/WifiStateMachine.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)