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

Commit c7ab7a36 authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Merge "Fix lack of notification of un-parent on disconnecting conference child." into oc-dev

am: a32bdf72

Change-Id: I8db5151004940974b5638ad689659473fcd82895
parents 3579818e a32bdf72
Loading
Loading
Loading
Loading
+19 −15
Original line number Diff line number Diff line
@@ -1876,8 +1876,24 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable {
     * @param parentCall
     */
    void setParentAndChildCall(Call parentCall) {
        boolean isParentChanging = (mParentCall != parentCall);
        setParentCall(parentCall);
        setChildOf(parentCall);
        if (isParentChanging) {
            notifyParentChanged(parentCall);
        }
    }

    /**
     * Notifies listeners when the parent call changes.
     * Used by {@link #setParentAndChildCall(Call)}, and in {@link CallsManager}.
     * @param parentCall The new parent call for this call.
     */
    void notifyParentChanged(Call parentCall) {
        Log.addEvent(this, LogUtils.Events.SET_PARENT, parentCall);
        for (Listener l : mListeners) {
            l.onParentChanged(this);
        }
    }

    /**
@@ -1906,25 +1922,13 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable {
     * To be called after {@link #setParentCall(Call)} to complete setting the parent by adding
     * this call as a child of another call.
     * <p>
     * Note: The fact that the {@link Listener#onParentChanged(Call)} callback is called here seems
     * counter-intuitive; it is done here so that when this method is called from
     * {@link CallsManager#createCallForExistingConnection(String, ParcelableConnection)} we can
     * delay informing InCallServices of the change in parent relationship until AFTER the call has
     * been added to Telecom.
     * Note: if using this method alone, the caller must call {@link #notifyParentChanged(Call)} to
     * ensure the InCall UI is updated with the change in parent.
     * @param parentCall The new parent for this call.
     */
    void setChildOf(Call parentCall) {
        if (parentCall == null) {
            return;
        }

        if (!parentCall.getChildCalls().contains(this)) {
        if (parentCall != null && !parentCall.getChildCalls().contains(this)) {
            parentCall.addChildCall(this);

            Log.addEvent(this, LogUtils.Events.SET_PARENT, parentCall);
            for (Listener l : mListeners) {
                l.onParentChanged(this);
            }
        }
    }

+1 −0
Original line number Diff line number Diff line
@@ -2548,6 +2548,7 @@ public class CallsManager extends Call.ListenerBase
            // Now, set the call as a child of the parent since it has been added to Telecom.  This
            // is where we will inform InCall.
            call.setChildOf(parentCall);
            call.notifyParentChanged(parentCall);
        }

        return call;