Skip to content

Commit 87f0a7b

Browse files
committed
Fix CS wakelock handling
Change-Id: Ibe1c1ab3e26ff0ae7cab7bfb0bd868bfab246037
1 parent fb90df8 commit 87f0a7b

File tree

2 files changed

+5
-17
lines changed

2 files changed

+5
-17
lines changed

services/java/com/android/server/WifiService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,6 @@ private void updateWifiState() {
10781078
mWifiStateMachine.setHighPerfModeEnabled(strongestLockMode
10791079
== WifiManager.WIFI_MODE_FULL_HIGH_PERF);
10801080
} else {
1081-
mWifiStateMachine.requestCmWakeLock();
10821081
mWifiStateMachine.setDriverStart(false);
10831082
}
10841083
} else {

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

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,6 @@ public class WifiStateMachine extends StateMachine {
306306
static final int CMD_SET_HIGH_PERF_MODE = BASE + 77;
307307
/* Set the country code */
308308
static final int CMD_SET_COUNTRY_CODE = BASE + 80;
309-
/* Request connectivity manager wake lock before driver stop */
310-
static final int CMD_REQUEST_CM_WAKELOCK = BASE + 81;
311309
/* Enables RSSI poll */
312310
static final int CMD_ENABLE_RSSI_POLL = BASE + 82;
313311
/* RSSI poll */
@@ -1061,15 +1059,6 @@ public boolean syncSaveConfig(AsyncChannel channel) {
10611059
return result;
10621060
}
10631061

1064-
/**
1065-
* Request a wakelock with connectivity service to
1066-
* keep the device awake until we hand-off from wifi
1067-
* to an alternate network
1068-
*/
1069-
public void requestCmWakeLock() {
1070-
sendMessage(CMD_REQUEST_CM_WAKELOCK);
1071-
}
1072-
10731062
public void updateBatteryWorkSource(WorkSource newSource) {
10741063
synchronized (mRunningWifiUids) {
10751064
try {
@@ -1867,7 +1856,6 @@ public boolean processMessage(Message message) {
18671856
case CMD_SET_HIGH_PERF_MODE:
18681857
case CMD_SET_COUNTRY_CODE:
18691858
case CMD_SET_FREQUENCY_BAND:
1870-
case CMD_REQUEST_CM_WAKELOCK:
18711859
case CMD_CONNECT_NETWORK:
18721860
case CMD_SAVE_NETWORK:
18731861
case CMD_FORGET_NETWORK:
@@ -3024,10 +3012,6 @@ public boolean processMessage(Message message) {
30243012
WifiNative.disconnectCommand();
30253013
transitionTo(mDisconnectingState);
30263014
break;
3027-
case CMD_REQUEST_CM_WAKELOCK:
3028-
checkAndSetConnectivityInstance();
3029-
mCm.requestNetworkTransitionWakelock(TAG);
3030-
break;
30313015
case CMD_SET_SCAN_MODE:
30323016
if (message.arg1 == SCAN_ONLY_MODE) {
30333017
sendMessage(CMD_DISCONNECT);
@@ -3100,6 +3084,11 @@ public boolean processMessage(Message message) {
31003084
}
31013085
@Override
31023086
public void exit() {
3087+
3088+
/* Request a CS wakelock during transition to mobile */
3089+
checkAndSetConnectivityInstance();
3090+
mCm.requestNetworkTransitionWakelock(TAG);
3091+
31033092
/* If a scan result is pending in connected state, the supplicant
31043093
* is in SCAN_ONLY_MODE. Restore CONNECT_MODE on exit
31053094
*/

0 commit comments

Comments
 (0)