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

Commit 16f38bda authored by Jack Yu's avatar Jack Yu Committed by Hui Wang
Browse files

Fixed incorrect unregister from connectivity service

We should only unregister when the data connection is
not being handover or handover completed.

Fix: 176000446
Fix: 160443926
Test: Manual
Merged-In: Idef20e1cd832623f8052e4701621f876b065ef6e
Change-Id: Idef20e1cd832623f8052e4701621f876b065ef6e
parent 8119a319
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -299,7 +299,7 @@ public class DataConnection extends StateMachine {
    public int mCid;

    @HandoverState
    private int mHandoverState;
    private int mHandoverState = HANDOVER_STATE_IDLE;
    private final Map<ApnContext, ConnectionParams> mApnContexts = new ConcurrentHashMap<>();
    PendingIntent mReconnectIntent = null;

@@ -958,6 +958,7 @@ public class DataConnection extends StateMachine {
        mUnmeteredOverride = false;
        mDownlinkBandwidth = 14;
        mUplinkBandwidth = 14;
        mHandoverState = HANDOVER_STATE_IDLE;
    }

    /**
@@ -2275,7 +2276,9 @@ public class DataConnection extends StateMachine {
            // data connection is disconnected. If we don't own this agent at this point, that means
            // it has been transferred to the new data connection for IWLAN data handover case.
            if (mNetworkAgent != null) {
                mNetworkAgent.sendNetworkInfo(mNetworkInfo, DataConnection.this);
                if (mHandoverState == HANDOVER_STATE_IDLE) {
                    mNetworkAgent.unregister(DataConnection.this);
                }
                mNetworkAgent.releaseOwnership(DataConnection.this);
            }
            mNetworkAgent = null;