diff options
author | Irfan Sheriff <isheriff@google.com> | 2010-12-03 17:00:13 -0800 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2010-12-03 17:00:13 -0800 |
commit | 9beea36441ef805a8a3c343553e281f1966c047e (patch) | |
tree | 01103d93b0d1ab6904e5ad2bed65639b886e7f37 /wifi/java | |
parent | 988f382308f4d6c743a3d85462184ed077c3a36e (diff) | |
download | frameworks_base-9beea36441ef805a8a3c343553e281f1966c047e.zip frameworks_base-9beea36441ef805a8a3c343553e281f1966c047e.tar.gz frameworks_base-9beea36441ef805a8a3c343553e281f1966c047e.tar.bz2 |
Hold network hand-off wakelock only when connected
Change-Id: I31132cb2966cfc1eb205e070116b4c784d292f46
Diffstat (limited to 'wifi/java')
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index 4828700b..7ad2ca8 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -924,7 +924,9 @@ public class WifiStateMachine extends HierarchicalStateMachine { } /** - * TODO: doc + * 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); @@ -2153,13 +2155,6 @@ public class WifiStateMachine extends HierarchicalStateMachine { transitionTo(mDriverStoppingState); mWakeLock.release(); break; - case CMD_REQUEST_CM_WAKELOCK: - if (mCm == null) { - mCm = (ConnectivityManager)mContext.getSystemService( - Context.CONNECTIVITY_SERVICE); - } - mCm.requestNetworkTransitionWakelock(TAG); - break; case CMD_START_PACKET_FILTERING: WifiNative.startPacketFiltering(); break; @@ -2637,6 +2632,13 @@ public class WifiStateMachine extends HierarchicalStateMachine { sendMessage(CMD_DISCONNECT); deferMessage(message); break; + case CMD_REQUEST_CM_WAKELOCK: + if (mCm == null) { + mCm = (ConnectivityManager)mContext.getSystemService( + Context.CONNECTIVITY_SERVICE); + } + mCm.requestNetworkTransitionWakelock(TAG); + break; case CMD_SET_SCAN_MODE: if (message.arg1 == SCAN_ONLY_MODE) { sendMessage(CMD_DISCONNECT); |