Merge "Fix CS wakelock handling" into ics-mr1
This commit is contained in:
committed by
Android (Google) Code Review
commit
a85cc28229
@ -1078,7 +1078,6 @@ public class WifiService extends IWifiManager.Stub {
|
|||||||
mWifiStateMachine.setHighPerfModeEnabled(strongestLockMode
|
mWifiStateMachine.setHighPerfModeEnabled(strongestLockMode
|
||||||
== WifiManager.WIFI_MODE_FULL_HIGH_PERF);
|
== WifiManager.WIFI_MODE_FULL_HIGH_PERF);
|
||||||
} else {
|
} else {
|
||||||
mWifiStateMachine.requestCmWakeLock();
|
|
||||||
mWifiStateMachine.setDriverStart(false);
|
mWifiStateMachine.setDriverStart(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -306,8 +306,6 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
static final int CMD_SET_HIGH_PERF_MODE = BASE + 77;
|
static final int CMD_SET_HIGH_PERF_MODE = BASE + 77;
|
||||||
/* Set the country code */
|
/* Set the country code */
|
||||||
static final int CMD_SET_COUNTRY_CODE = BASE + 80;
|
static final int CMD_SET_COUNTRY_CODE = BASE + 80;
|
||||||
/* Request connectivity manager wake lock before driver stop */
|
|
||||||
static final int CMD_REQUEST_CM_WAKELOCK = BASE + 81;
|
|
||||||
/* Enables RSSI poll */
|
/* Enables RSSI poll */
|
||||||
static final int CMD_ENABLE_RSSI_POLL = BASE + 82;
|
static final int CMD_ENABLE_RSSI_POLL = BASE + 82;
|
||||||
/* RSSI poll */
|
/* RSSI poll */
|
||||||
@ -1061,15 +1059,6 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Request a wakelock with connectivity service to
|
|
||||||
* keep the device awake until we hand-off from wifi
|
|
||||||
* to an alternate network
|
|
||||||
*/
|
|
||||||
public void requestCmWakeLock() {
|
|
||||||
sendMessage(CMD_REQUEST_CM_WAKELOCK);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateBatteryWorkSource(WorkSource newSource) {
|
public void updateBatteryWorkSource(WorkSource newSource) {
|
||||||
synchronized (mRunningWifiUids) {
|
synchronized (mRunningWifiUids) {
|
||||||
try {
|
try {
|
||||||
@ -1867,7 +1856,6 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
case CMD_SET_HIGH_PERF_MODE:
|
case CMD_SET_HIGH_PERF_MODE:
|
||||||
case CMD_SET_COUNTRY_CODE:
|
case CMD_SET_COUNTRY_CODE:
|
||||||
case CMD_SET_FREQUENCY_BAND:
|
case CMD_SET_FREQUENCY_BAND:
|
||||||
case CMD_REQUEST_CM_WAKELOCK:
|
|
||||||
case CMD_CONNECT_NETWORK:
|
case CMD_CONNECT_NETWORK:
|
||||||
case CMD_SAVE_NETWORK:
|
case CMD_SAVE_NETWORK:
|
||||||
case CMD_FORGET_NETWORK:
|
case CMD_FORGET_NETWORK:
|
||||||
@ -3024,10 +3012,6 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
WifiNative.disconnectCommand();
|
WifiNative.disconnectCommand();
|
||||||
transitionTo(mDisconnectingState);
|
transitionTo(mDisconnectingState);
|
||||||
break;
|
break;
|
||||||
case CMD_REQUEST_CM_WAKELOCK:
|
|
||||||
checkAndSetConnectivityInstance();
|
|
||||||
mCm.requestNetworkTransitionWakelock(TAG);
|
|
||||||
break;
|
|
||||||
case CMD_SET_SCAN_MODE:
|
case CMD_SET_SCAN_MODE:
|
||||||
if (message.arg1 == SCAN_ONLY_MODE) {
|
if (message.arg1 == SCAN_ONLY_MODE) {
|
||||||
sendMessage(CMD_DISCONNECT);
|
sendMessage(CMD_DISCONNECT);
|
||||||
@ -3100,6 +3084,11 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void exit() {
|
public void exit() {
|
||||||
|
|
||||||
|
/* Request a CS wakelock during transition to mobile */
|
||||||
|
checkAndSetConnectivityInstance();
|
||||||
|
mCm.requestNetworkTransitionWakelock(TAG);
|
||||||
|
|
||||||
/* If a scan result is pending in connected state, the supplicant
|
/* If a scan result is pending in connected state, the supplicant
|
||||||
* is in SCAN_ONLY_MODE. Restore CONNECT_MODE on exit
|
* is in SCAN_ONLY_MODE. Restore CONNECT_MODE on exit
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user