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

Commit c7c2aff3 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Fixing resume of FG call after failure to merge IMS calls.

The problem was due to a bug in switchWaitingOrHoldingAndActive.  When
we start a swap between FG and BG calls, a flag mSwitchingFgAndBgCalls is
set so that we can detect situations where the swap fails and "unswap" the
calls.

The original switchWaitingOrHoldingAndActive which occurs when dialing out
the new call to add to the conference was failing to toggle
mSwitchingFgAndBgCalls back off because no onCallResume is received (this
is where the flag was turned off in the past).

To fix this I reset the mSwitchingFgAndBgCalls flag when we get an unhold
and do not request a resume.

Bug: 19034876
Change-Id: If9f2360bbf3d7294b856ab021e3a0a8c46f2d928
parent 52c193f0
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1033,6 +1033,11 @@ public final class ImsPhoneCallTracker extends CallTracker {
                ImsPhoneCall.State oldState = mBackgroundCall.getState();
                processCallStateChange(imsCall, ImsPhoneCall.State.HOLDING,
                        DisconnectCause.NOT_DISCONNECTED);

                // Note: If we're performing a switchWaitingOrHoldingAndActive, the call to
                // processCallStateChange above may have caused the mBackgroundCall and
                // mForegroundCall references below to change meaning.  Watch out for this if you
                // are reading through this code.
                if (oldState == ImsPhoneCall.State.ACTIVE) {
                    // Note: This case comes up when we have just held a call in response to a
                    // switchWaitingOrHoldingAndActive.  We now need to resume the background call.
@@ -1048,6 +1053,12 @@ public final class ImsPhoneCallTracker extends CallTracker {
                        if (mPendingMO != null) {
                            sendEmptyMessage(EVENT_DIAL_PENDINGMO);
                        }

                        // In this case there will be no call resumed, so we can assume that we
                        // are done switching fg and bg calls now.
                        // This may happen if there is no BG call and we are holding a call so that
                        // we can dial another one.
                        mSwitchingFgAndBgCalls = false;
                    }
                }
            }