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

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

Fix issues associated with hold failure

When a call hold fails, pass that fact up the stack as a connection
event.

Fixes: 128275255
Test: manual
Change-Id: I126fc2b4a1c42c26e34dccd2596f6b2ef3bb5716
parent 27b093b7
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -2447,6 +2447,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    // disconnected while processing hold
                    if (mPendingMO != null) {
                        dialPendingMO();
                    } else if (mRingingCall.getState() == ImsPhoneCall.State.WAITING
                            && mHoldSwitchingState == HoldSwapState.HOLDING_TO_ANSWER_INCOMING) {
                        sendEmptyMessage(EVENT_ANSWER_WAITING_CALL);
                    }
                    mHoldSwitchingState = HoldSwapState.INACTIVE;
                } else if (mPendingMO != null && mPendingMO.isEmergency()) {
@@ -2469,6 +2472,16 @@ 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) {
                    conn.onConnectionEvent(android.telecom.Connection.EVENT_CALL_HOLD_FAILED, null);
                }
                mPhone.notifySuppServiceFailed(Phone.SuppService.HOLD);
            }