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

Commit 52c1bebc authored by Anthony Lee's avatar Anthony Lee
Browse files

Add plumbing for merge failures and renable button. (4/4)

The merge failure is not plumbed up through any layer that
can trap the callback and act on it.  The first part of this
fix is to create that plumbing.  Then we need to reenable the
merge button. At this point in time, we leverage the fact
that forcing the call to reassess its capabilities will poke
the InCallUI to reenable the merge button. In the future, we
should plumb the merge failure all the way to InCallUI and
not only handle the button but display UI to the user. The UI
is currently being displayed by CallNotifier which is the wrong
place. See b/20530631 for more details.

Bug: 20229905
Change-Id: I9a49b25b7ed08061db804e8afd01a0a34be7370c
parent 93350616
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public abstract class Connection {
        public void onConferenceParticipantsChanged(List<ConferenceParticipant> participants);
        public void onCallSubstateChanged(int callSubstate);
        public void onMultipartyStateChanged(boolean isMultiParty);
        public void onConferenceMergedFailed();
    }

    /**
@@ -77,6 +78,8 @@ public abstract class Connection {
        public void onCallSubstateChanged(int callSubstate) {}
        @Override
        public void onMultipartyStateChanged(boolean isMultiParty) {}
        @Override
        public void onConferenceMergedFailed() {}
    }

    public static final int AUDIO_QUALITY_STANDARD = 1;
@@ -640,7 +643,7 @@ public abstract class Connection {
    }

    /**
     * Notifies listeners of a change to the multiparty state of the connection..
     * Notifies listeners of a change to the multiparty state of the connection.
     *
     * @param isMultiparty The participant(s).
     */
@@ -650,6 +653,15 @@ public abstract class Connection {
        }
    }

    /**
     * Notifies listeners of a failure in merging this connection with the background connection.
     */
    public void onConferenceMergeFailed() {
        for (Listener l : mListeners) {
            l.onConferenceMergedFailed();
        }
    }

    /**
     * Notifies this Connection of a request to disconnect a participant of the conference managed
     * by the connection.
+11 −0
Original line number Diff line number Diff line
@@ -1206,7 +1206,18 @@ public final class ImsPhoneCallTracker extends CallTracker {
        @Override
        public void onCallMergeFailed(ImsCall call, ImsReasonInfo reasonInfo) {
            if (DBG) log("onCallMergeFailed reasonInfo=" + reasonInfo);

            // TODO: the call to notifySuppServiceFailed throws up the "merge failed" dialog
            // We should move this into the InCallService so that it is handled appropriately
            // based on the user facing UI.
            mPhone.notifySuppServiceFailed(Phone.SuppService.CONFERENCE);

            // Start plumbing this even through Telecom so other components can take
            // appropriate action.
            ImsPhoneConnection conn = findConnection(call);
            if (conn != null) {
                conn.onConferenceMergeFailed();
            }
        }

        /**