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

Commit 8652ad58 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: Ia2954aefc204ac443eacd42024c3e458f4e2279c
parents d9b2ee2e 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(