Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit efd804b0 authored by Irfan Sheriff's avatar Irfan Sheriff Committed by Android (Google) Code Review
Browse files

Merge "Hold network hand-off wakelock only when connected"

parents 28bec9eb 9beea364
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -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);