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

Commit afb0fad6 authored by Anju Mathapati's avatar Anju Mathapati Committed by Santos Cordon
Browse files

IMS: During a call swap, handle the resume failure

During a call swap, the active call is first placed on hold,
followed by the resume of the already held call. If this
resume attempt fails, then try to recover by resuming the
original active call.

Fix: 25498498
Change-Id: I9dc83e95e79fd04f9a080572ac861d30dd916c5c
parent f83b2ff8
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -1426,14 +1426,22 @@ public class ImsPhoneCallTracker extends CallTracker {

        @Override
        public void onCallResumeFailed(ImsCall imsCall, ImsReasonInfo reasonInfo) {
            // If we are in the midst of swapping the FG and BG calls and we got a resume fail, we
            // need to swap back the FG and BG calls.
            if (mSwitchingFgAndBgCalls && imsCall == mCallExpectedToResume) {
            if (mSwitchingFgAndBgCalls) {
                // If we are in the midst of swapping the FG and BG calls and
                // we got a resume fail, we need to swap back the FG and BG calls.
                // Since the FG call was held, will also try to resume the same.
                if (imsCall == mCallExpectedToResume) {
                    if (DBG) {
                        log("onCallResumeFailed : switching " + mForegroundCall + " with "
                                + mBackgroundCall);
                    }
                    mForegroundCall.switchWith(mBackgroundCall);
                    if (mForegroundCall.getState() == ImsPhoneCall.State.HOLDING) {
                            sendEmptyMessage(EVENT_RESUME_BACKGROUND);
                    }
                }

                //Call swap is done, reset the relevant variables
                mCallExpectedToResume = null;
                mSwitchingFgAndBgCalls = false;
            }