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

Commit bffd07cc authored by Mayukh Chatterjee's avatar Mayukh Chatterjee Committed by Linux Build Service Account
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.

Change-Id: I27a1d4fa09d4dd8e6dbb78d2fe60efe1b230e0e6
CRs-Fixed: 1002700
parent 1fe43dfe
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -272,6 +272,8 @@ public class Call implements CreateConnectionResponse {

    private boolean mSpeakerphoneOn;

    private boolean mIsHoldInConference = false;

    /**
     * Tracks the video states which were applicable over the duration of a call.
     * See {@link VideoProfile} for a list of valid video states.
@@ -613,6 +615,14 @@ public class Call implements CreateConnectionResponse {
            mState = newState;
            maybeLoadCannedSmsResponses();

            if (mState == CallState.ON_HOLD && getParentCall() != null) {
                Log.v(this, "setState is conference hold, %s", mState);
                mIsHoldInConference = true;
            } else if (mState != CallState.DISCONNECTED) {
                Log.v(this, "setState is not conference hold, %s", mState);
                mIsHoldInConference = false;
            }

            if (mState == CallState.ACTIVE || mState == CallState.ON_HOLD) {
                if (mConnectTimeMillis == 0) {
                    // We check to see if mConnectTime is already set to prevent the
@@ -1030,6 +1040,10 @@ public class Call implements CreateConnectionResponse {
        return mWasConferencePreviouslyMerged;
    }

    boolean isHoldInConference() {
        return mIsHoldInConference;
    }

    @VisibleForTesting
    public Call getConferenceLevelActiveCall() {
        return mConferenceLevelActiveCall;
@@ -1326,6 +1340,9 @@ public class Call implements CreateConnectionResponse {
        if (mState == CallState.ACTIVE) {
            mConnectionService.hold(this);
            Log.event(this, Log.Events.REQUEST_HOLD);
            if (getParentCall() != null) {
                mIsHoldInConference = true;
            }
        }
    }

@@ -1338,6 +1355,7 @@ public class Call implements CreateConnectionResponse {
        if (mState == CallState.ON_HOLD) {
            mConnectionService.unhold(this);
            Log.event(this, Log.Events.REQUEST_UNHOLD);
            mIsHoldInConference = false;
        }
    }

+6 −1
Original line number Diff line number Diff line
@@ -1535,6 +1535,10 @@ public class CallsManager extends Call.ListenerBase
     * Removes an existing disconnected call, and notifies the in-call app.
     */
    void markCallAsRemoved(Call call) {
        boolean isHoldInConference = call.isHoldInConference();
        Log.v(this, "markCallAsRemoved: isHoldInConference = "
                + isHoldInConference + "call -> %s", call);

        removeCall(call);
        if (!hasAnyCalls()) {
            updateLchStatus(null);
@@ -1544,7 +1548,8 @@ public class CallsManager extends Call.ListenerBase
        if (mLocallyDisconnectingCalls.contains(call)) {
            mLocallyDisconnectingCalls.remove(call);
            Call foregroundCall = mCallAudioManager.getPossiblyHeldForegroundCall();
            if (foregroundCall != null && foregroundCall.getState() == CallState.ON_HOLD) {
            if (!isHoldInConference && foregroundCall != null
                    && foregroundCall.getState() == CallState.ON_HOLD) {
                foregroundCall.unhold();
            }
        }