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

Commit a7d94e63 authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Suppress conference initiation when already in the process of merging." into oc-dr1-dev

parents 35efea7f bc3ef42c
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -1203,8 +1203,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {

    public void
    conference() {
        if (DBG) log("conference");

        ImsCall fgImsCall = mForegroundCall.getImsCall();
        if (fgImsCall == null) {
            log("conference no foreground ims call");
@@ -1217,6 +1215,16 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            return;
        }

        if (fgImsCall.isCallSessionMergePending()) {
            log("conference: skip; foreground call already in process of merging.");
            return;
        }

        if (bgImsCall.isCallSessionMergePending()) {
            log("conference: skip; background call already in process of merging.");
            return;
        }

        // Keep track of the connect time of the earliest call so that it can be set on the
        // {@code ImsConference} when it is created.
        long foregroundConnectTime = mForegroundCall.getEarliestConnectTime();
@@ -1234,15 +1242,20 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            conferenceConnectTime = backgroundConnectTime;
        }

        String foregroundId = "";
        ImsPhoneConnection foregroundConnection = mForegroundCall.getFirstConnection();
        if (foregroundConnection != null) {
            foregroundConnection.setConferenceConnectTime(conferenceConnectTime);
            foregroundConnection.handleMergeStart();
            foregroundId = foregroundConnection.getTelecomCallId();
        }
        String backgroundId = "";
        ImsPhoneConnection backgroundConnection = findConnection(bgImsCall);
        if (backgroundConnection != null) {
            backgroundConnection.handleMergeStart();
            backgroundId = backgroundConnection.getTelecomCallId();
        }
        log("conference: fgCallId=" + foregroundId + ", bgCallId=" + backgroundId);

        try {
            fgImsCall.merge(bgImsCall);