From 24aebf075911a84174a3f7382dd88dac008affec Mon Sep 17 00:00:00 2001 From: twyen Date: Fri, 11 May 2018 14:10:36 -0700 Subject: Don't show select SIM dialog after the pre call action has been discarded If the PreferredAccountWorker completed after a rotation, it might show a dialog from the previous action which is no longer valid. TEST=TAP Bug: 79530586 Test: TAP PiperOrigin-RevId: 196306574 Change-Id: I1d64eb63ad4f0bbe0ccdb7b8f73f638f67c56070 --- java/com/android/dialer/precall/impl/CallingAccountSelector.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java index b22e4d973..b2a659348 100644 --- a/java/com/android/dialer/precall/impl/CallingAccountSelector.java +++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java @@ -132,6 +132,10 @@ public class CallingAccountSelector implements PreCallAction { phoneNumber, activity.getSystemService(TelecomManager.class).getCallCapablePhoneAccounts()), result -> { + if (isDiscarding) { + // pendingAction is dropped by the coordinator before onDiscard is triggered. + return; + } if (result.getSelectedPhoneAccountHandle().isPresent()) { if (result.getSuggestion().isPresent() -- cgit v1.2.3