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

Commit bd950b26 authored by Grace Jia's avatar Grace Jia
Browse files

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

Currently we compare call ID from user interaction and saved pending
redirection request call ID to make sure we send the correct request.
But if there's a previous stuck pending request, all requests after that
will be blocked. When the call ID can't match, just cancel the previous
one.

Bug: 182215787
Test: Manually test, TelecomUnitTest
Change-Id: Ib223845138145ecab92e5fec0d2160aba577936b
parent 9c0a5dc0
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(