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

Commit c0290612 authored by Srikanth Chintala's avatar Srikanth Chintala Committed by android-build-merger
Browse files

Held Conference call should not be automatically resumed

am: 5bf75021

Change-Id: I32b16b41616ed985cabfe89866a76f2882812a88
parents c016cb74 5bf75021
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -289,6 +289,8 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable {

    private boolean mSpeakerphoneOn;

    private boolean mIsDisconnectingChildCall = false;

    /**
     * Tracks the video states which were applicable over the duration of a call.
     * See {@link VideoProfile} for a list of valid video states.
@@ -1179,6 +1181,19 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable {
        return mWasConferencePreviouslyMerged;
    }

    public boolean isDisconnectingChildCall() {
        return mIsDisconnectingChildCall;
    }

    /**
     * Sets whether this call is a child call.
     */
    private void maybeSetCallAsDisconnectingChild() {
        if (mParentCall != null) {
            mIsDisconnectingChildCall = true;
        }
    }

    @VisibleForTesting
    public Call getConferenceLevelActiveCall() {
        return mConferenceLevelActiveCall;
@@ -1402,6 +1417,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable {

        // Track that the call is now locally disconnecting.
        setLocallyDisconnecting(true);
        maybeSetCallAsDisconnectingChild();

        if (mState == CallState.NEW || mState == CallState.SELECT_PHONE_ACCOUNT ||
                mState == CallState.CONNECTING) {
+8 −1
Original line number Diff line number Diff line
@@ -1531,8 +1531,15 @@ public class CallsManager extends Call.ListenerBase
        removeCall(call);
        Call foregroundCall = mCallAudioManager.getPossiblyHeldForegroundCall();
        if (mLocallyDisconnectingCalls.contains(call)) {
            boolean isDisconnectingChildCall = call.isDisconnectingChildCall();
            Log.v(this, "markCallAsRemoved: isDisconnectingChildCall = "
                + isDisconnectingChildCall + "call -> %s", call);
            mLocallyDisconnectingCalls.remove(call);
            if (foregroundCall != null && foregroundCall.getState() == CallState.ON_HOLD) {
            // Auto-unhold the foreground call due to a locally disconnected call, except if the
            // call which was disconnected is a member of a conference (don't want to auto un-hold
            // the conference if we remove a member of the conference).
            if (!isDisconnectingChildCall && foregroundCall != null
                    && foregroundCall.getState() == CallState.ON_HOLD) {
                foregroundCall.unhold();
            }
        } else if (foregroundCall != null &&