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

Commit 7d43f35f authored by Grace Jia's avatar Grace Jia Committed by Automerger Merge Worker
Browse files

Cancel pending call redirection request if there's new one. am: bd950b26

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telecomm/+/14550638

Change-Id: I9d0533057962ef5b173a2ad0de215ae0a76623b0
parents 42d983fd bd950b26
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2258,8 +2258,16 @@ public class CallsManager extends Call.ListenerBase
    public void processRedirectedOutgoingCallAfterUserInteraction(String callId, String action) {
        Log.i(this, "processRedirectedOutgoingCallAfterUserInteraction for Call ID %s, action=%s",
                callId, action);
        if (mPendingRedirectedOutgoingCall != null && mPendingRedirectedOutgoingCall.getId()
                .equals(callId)) {
        if (mPendingRedirectedOutgoingCall != null) {
            String pendingCallId = mPendingRedirectedOutgoingCall.getId();
            if (!pendingCallId.equals(callId)) {
                Log.i(this, "processRedirectedOutgoingCallAfterUserInteraction for new Call ID %s, "
                        + "cancel the previous pending Call with ID %s", callId, pendingCallId);
                mPendingRedirectedOutgoingCall.disconnect("Another call redirection requested");
                mPendingRedirectedOutgoingCallInfo.remove(pendingCallId);
                mPendingUnredirectedOutgoingCallInfo.remove(pendingCallId);
            }

            if (action.equals(TelecomBroadcastIntentProcessor.ACTION_PLACE_REDIRECTED_CALL)) {
                mHandler.post(mPendingRedirectedOutgoingCallInfo.get(callId).prepare());
            } else if (action.equals(