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

Commit 232c11a5 authored by Ravindra's avatar Ravindra Committed by Gerrit - the friendly Code Review server
Browse files

Fix to create network agent.

If single data async is shared between two apn contexts then
check for disconnect messages based on apn context when state
state machine is about to move to active state.

Change-Id: I389b31b766bc6a21e5ab0afabaf14307c7367d72
CRs-Fixed: 1049393
parent c0f6c529
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -1480,6 +1480,10 @@ public class DataConnection extends StateMachine {
    }
    private DcActivatingState mActivatingState = new DcActivatingState();

    public final boolean hasMessages(int what, Object object) {
        return DataConnection.this.getHandler().hasMessages(what, object);
    }

    /**
     * The state machine is connected, expecting an EVENT_DISCONNECT.
     */
@@ -1489,10 +1493,12 @@ public class DataConnection extends StateMachine {

            boolean createNetworkAgent = true;
            // If a disconnect is already pending, avoid notifying all of connected
            if (hasMessages(EVENT_DISCONNECT) ||
                    hasMessages(EVENT_DISCONNECT_ALL) ||
                    hasDeferredMessages(EVENT_DISCONNECT) ||
                    hasDeferredMessages(EVENT_DISCONNECT_ALL)) {
            if (hasMessages(EVENT_DISCONNECT, mConnectionParams.mOnCompletedMsg.obj) ||
                    hasMessages(EVENT_DISCONNECT_ALL, mConnectionParams.
                    mOnCompletedMsg.obj) || hasDeferredMessages(EVENT_DISCONNECT,
                    mConnectionParams.mOnCompletedMsg.obj) ||
                    hasDeferredMessages(EVENT_DISCONNECT_ALL, mConnectionParams.
                    mOnCompletedMsg.obj)) {
                log("DcActiveState: skipping notifyAllOfConnected()");
                createNetworkAgent = false;
            } else {