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

Commit bc3ef42c authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Suppress conference initiation when already in the process of merging.

When a conference merge is already in process, skip initiation of a
conference merge requested by the user.  This ensures if the user hammers
on the merge button in the UI or mistakenly double-taps, the modem won't
try to merge multiple times, one which will fail and generate an error
to the user.

Also cleaned up the log messages a wee bit to show the call IDs of the
calls merging.

Test: Manual
Bug: 38151476
Change-Id: I8a7e0d104b10d1d1cfbc6a76d8bf62a0adfa85c5
parent d0ef1461
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);