diff options
Diffstat (limited to 'java/com/android/dialer/precall/impl/CallingAccountSelector.java')
-rw-r--r-- | java/com/android/dialer/precall/impl/CallingAccountSelector.java | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/java/com/android/dialer/precall/impl/CallingAccountSelector.java b/java/com/android/dialer/precall/impl/CallingAccountSelector.java index 144d94e20..4d2e6063a 100644 --- a/java/com/android/dialer/precall/impl/CallingAccountSelector.java +++ b/java/com/android/dialer/precall/impl/CallingAccountSelector.java @@ -119,12 +119,12 @@ public class CallingAccountSelector implements PreCallAction { PendingAction pendingAction = coordinator.startPendingAction(); DialerExecutorComponent.get(coordinator.getActivity()) .dialerExecutorFactory() - .createUiTaskBuilder( - activity.getFragmentManager(), - "PreferredAccountWorker", - new PreferredAccountWorker(phoneNumber)) + .createNonUiTaskBuilder(new PreferredAccountWorker(phoneNumber)) .onSuccess( (result -> { + if (isDiscarding) { + return; + } if (result.phoneAccountHandle.isPresent()) { coordinator.getBuilder().setPhoneAccountHandle(result.phoneAccountHandle.get()); pendingAction.finish(); @@ -213,7 +213,9 @@ public class CallingAccountSelector implements PreCallAction { @Override public void onDiscard() { isDiscarding = true; - selectPhoneAccountDialogFragment.dismiss(); + if (selectPhoneAccountDialogFragment != null) { + selectPhoneAccountDialogFragment.dismiss(); + } } private static class PreferredAccountWorkerResult { @@ -353,11 +355,13 @@ public class CallingAccountSelector implements PreCallAction { new WritePreferredAccountWorkerInput( coordinator.getActivity(), dataId, selectedAccountHandle)); } - DialerExecutorComponent.get(coordinator.getActivity()) - .dialerExecutorFactory() - .createNonUiTaskBuilder(new UserSelectionReporter(selectedAccountHandle, number)) - .build() - .executeParallel(coordinator.getActivity()); + if (number != null) { + DialerExecutorComponent.get(coordinator.getActivity()) + .dialerExecutorFactory() + .createNonUiTaskBuilder(new UserSelectionReporter(selectedAccountHandle, number)) + .build() + .executeParallel(coordinator.getActivity()); + } listener.finish(); } |