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

Commit 278fdb13 authored by qing's avatar qing Committed by Qing Zhong
Browse files

Make call back order right for DISCONNECTED call

If call is initially a DISCONNECTED call, the callback will be fire in wrong sequence where onCallRemoved is fired before onCallAdded.
Bug: 203563157
Test: manual test


Change-Id: I4b13dc13b34a1547f0c68ced01b3c1177dfa9eb3
(cherry picked from commit 5495c83fb5dbf833082ce4c9c21c415580420a7f)
(cherry picked from commit fb9aec0c1175618759f5d7328fc42ec3c152cbe2)
parent eae843b7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -2661,7 +2661,9 @@ public final class Call {
        // remove ourselves from the Phone. Note that we do this after completing all state updates
        // so a client can cleanly transition all their UI to the state appropriate for a
        // DISCONNECTED Call while still relying on the existence of that Call in the Phone's list.
        if (mState == STATE_DISCONNECTED) {
        // Check if the original state is already disconnected, otherwise onCallRemoved will be
        // triggered before onCallAdded.
        if (mState == STATE_DISCONNECTED && stateChanged) {
            fireCallDestroyed();
        }
    }
+3 −0
Original line number Diff line number Diff line
@@ -174,6 +174,9 @@ public final class Phone {
            checkCallTree(parcelableCall);
            call.internalUpdate(parcelableCall, mCallByTelecomCallId);
            fireCallAdded(call);
            if (call.getState() == Call.STATE_DISCONNECTED) {
                internalRemoveCall(call);
            }
        } else {
            Log.w(this, "Call %s added, but it was already present", call.internalGetCallId());
            checkCallTree(parcelableCall);