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

Commit d22acc87 authored by Hall Liu's avatar Hall Liu
Browse files

Amend earlier fix for hold failures

Check the bgState condition last during a hold failure so that we
actually get to the case where the call waiting call is present is
actually considered.

Test: manual
Fixes: 128275255
Change-Id: Ia38adee3cacb154f21ef3ca95eb18c33ae1279be
parent ece0cedc
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -2461,6 +2461,13 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    }
                    // Leave mHoldSwitchingState as is for now -- we'll reset it
                    // in onCallTerminated, which will also dial the outgoing emergency call.
                } else if (mRingingCall.getState() == ImsPhoneCall.State.WAITING
                        && mHoldSwitchingState == HoldSwapState.HOLDING_TO_ANSWER_INCOMING) {
                    // If we issued a hold request in order to answer an incoming call, we need
                    // to tell Telecom that we can't actually answer the incoming call.
                    mHoldSwitchingState = HoldSwapState.INACTIVE;
                    mForegroundCall.switchWith(mBackgroundCall);
                    logHoldSwapState("onCallHoldFailed unable to answer waiting call");
                } else if (bgState == ImsPhoneCall.State.ACTIVE) {
                    mForegroundCall.switchWith(mBackgroundCall);

@@ -2472,12 +2479,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                        mCallExpectedToResume = null;
                    }
                    mHoldSwitchingState = HoldSwapState.INACTIVE;
                } else if (mRingingCall.getState() == ImsPhoneCall.State.WAITING
                        && mHoldSwitchingState == HoldSwapState.HOLDING_TO_ANSWER_INCOMING) {
                    // If we issued a hold request in order to answer an incoming call, we need
                    // to tell Telecom that we can't actually answer the incoming call.
                    mHoldSwitchingState = HoldSwapState.INACTIVE;
                    logHoldSwapState("onCallHoldFailed unable to answer waiting call");
                }
                ImsPhoneConnection conn = findConnection(imsCall);
                if (conn != null) {