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

Commit a7d9eb03 authored by Nivedita Sarkar's avatar Nivedita Sarkar Committed by Linux Build Service Account
Browse files

Fix the issue - Unable to add second VT call when first call is active

- Cache the video state of the new pending call when the foreground
  call is HOLDING.

- Use the cached video state when dialing the pending MO call or
  accepting the pending MT call after the first call is put on HOLD.

Change-Id: I761dcc1e9b8383ea2eb39500873dfa38401268bf
CRs-Fixed: 743214, 741286
parent acc6a814
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ public final class ImsPhoneCallTracker extends CallTracker {
    private boolean mIsInEmergencyCall = false;

    private int pendingCallClirMode;
    private int pendingCallVideoState;
    private int mPendingCallVideoState;
    private boolean pendingCallInEcm = false;

    //***** Events
@@ -324,6 +324,8 @@ public final class ImsPhoneCallTracker extends CallTracker {
            }
            // foreground call is empty for the newly dialed connection
            holdBeforeDial = true;
            // Cache the video state for pending MO call.
            mPendingCallVideoState = videoState;
            switchWaitingOrHoldingAndActive();
        }

@@ -366,7 +368,7 @@ public final class ImsPhoneCallTracker extends CallTracker {
                }
                mPhone.setOnEcbModeExitResponse(this, EVENT_EXIT_ECM_RESPONSE_CDMA, null);
                pendingCallClirMode = clirMode;
                pendingCallVideoState = videoState;
                mPendingCallVideoState = videoState;
                pendingCallInEcm = true;
            }
        }
@@ -493,6 +495,8 @@ public final class ImsPhoneCallTracker extends CallTracker {
        if ((mRingingCall.getState() == ImsPhoneCall.State.WAITING)
                && mForegroundCall.getState().isAlive()) {
            setMute(false);
            // Cache video state for pending MT call.
            mPendingCallVideoState = videoState;
            switchWaitingOrHoldingAndActive();
        } else if (mRingingCall.getState().isRinging()) {
            if (DBG) log("acceptCall: incoming...");
@@ -840,7 +844,10 @@ public final class ImsPhoneCallTracker extends CallTracker {
            } else if (mRingingCall.getState() == ImsPhoneCall.State.WAITING) {
                //accept waiting call after holding background call
                ImsCall imsCall = mRingingCall.getImsCall();
                if (imsCall != null) imsCall.accept(ImsCallProfile.CALL_TYPE_VOICE);
                if (imsCall != null) {
                    imsCall.accept(
                        ImsCallProfile.getCallTypeFromVideoState(mPendingCallVideoState));
                }
            } else {
                //Just resume background call.
                //To distinguish resuming call with swapping calls
@@ -1377,15 +1384,15 @@ public final class ImsPhoneCallTracker extends CallTracker {
                }
                break;
            case EVENT_DIAL_PENDINGMO:
                dialInternal(mPendingMO, mClirMode,
                        VideoProfile.VideoState.AUDIO_ONLY, mPendingMO.getCallExtras());
                dialInternal(mPendingMO, mClirMode, mPendingCallVideoState,
                    mPendingMO.getCallExtras());
                break;

            case EVENT_EXIT_ECM_RESPONSE_CDMA:
                // no matter the result, we still do the same here
                if (pendingCallInEcm) {
                    dialInternal(mPendingMO, pendingCallClirMode,
                            pendingCallVideoState, mPendingMO.getCallExtras());
                            mPendingCallVideoState, mPendingMO.getCallExtras());
                    pendingCallInEcm = false;
                }
                mPhone.unsetOnEcbModeExitResponse(this);