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

Commit 5bf75021 authored by Srikanth Chintala's avatar Srikanth Chintala Committed by Tyler Gunn
Browse files

Held Conference call should not be automatically resumed

While removing call, if the forground call is in hold, then
CallsManager in Telecom is trying to resume the call.
foreground call should not be resumed when the disconnected
call was one of the conference call. So, other calls state
will remain same as before.

Test: manual - conference call scenarios
Bug: 34830478
Change-Id: I27a1d4fa09d4dd8e6dbb78d2fe60efe1b230e0e6
parent b6618922
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
@@ -1496,8 +1496,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 &&