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

Commit 7ee3f31d authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Change conference connect time to ignore undefined connect times.

- The existing code to get the earliest connect time for a conference
could potentially return 0 (i.e. undefined).  Although I've not run into
this in my own testing, it is theoretically possible.
I suspect the reason that the connect time was being reset when starting
a conference is that one of the ImsCalls must be returning a connect time
of zero, which in Telecom is treated as "unspecified" (in other words,
no connect time specified, so use now).

Bug: 22089306
Change-Id: I79be11b67767650455600befbecf841ff8b87c09
parent d2137887
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -237,6 +237,8 @@ public class ImsPhoneCall extends Call {
            long conferenceConnectTime = imsPhoneConnection.getConferenceConnectTime();
            if (conferenceConnectTime > 0) {
                imsPhoneConnection.setConnectTime(conferenceConnectTime);
            } else {
                Rlog.d(LOG_TAG, "merge: conference connect time is 0");
            }
        }
        Rlog.d(LOG_TAG, "merge: " + that + "state = " + state);
+15 −2
Original line number Diff line number Diff line
@@ -533,8 +533,21 @@ public final class ImsPhoneCallTracker extends CallTracker {

        // 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 conferenceConnectTime = Math.min(mForegroundCall.getEarliestConnectTime(),
        long foregroundConnectTime = mForegroundCall.getEarliestConnectTime();
        long backgroundConnectTime = mBackgroundCall.getEarliestConnectTime();
        long conferenceConnectTime;
        if (foregroundConnectTime > 0 && backgroundConnectTime > 0) {
            conferenceConnectTime = Math.min(mForegroundCall.getEarliestConnectTime(),
                    mBackgroundCall.getEarliestConnectTime());
            log("conference - using connect time = " + conferenceConnectTime);
        } else if (foregroundConnectTime > 0) {
            log("conference - bg call connect time is 0; using fg = " + foregroundConnectTime);
            conferenceConnectTime = foregroundConnectTime;
        } else {
            log("conference - fg call connect time is 0; using bg = " + backgroundConnectTime);
            conferenceConnectTime = backgroundConnectTime;
        }

        ImsPhoneConnection foregroundConnection = mForegroundCall.getFirstConnection();
        if (foregroundConnection != null) {
            foregroundConnection.setConferenceConnectTime(conferenceConnectTime);