summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/main
diff options
context:
space:
mode:
authorcalderwoodra <calderwoodra@google.com>2018-03-16 11:48:49 -0700
committerCopybara-Service <copybara-piper@google.com>2018-03-16 12:41:05 -0700
commitd0fc91676dc50d1bde2247599401d6509aa8068b (patch)
treeabc18919ecf4fe280a028590a65d341b1dc23659 /java/com/android/dialer/main
parenta8e623280c43dc27ecede733c29917c9f18c3e6a (diff)
Check if dialpad is already open when handleing new intents.
If the user had the dialpad open when they received a call, they could potentially crash dialer if they pressed add call or clicked on a phone number in another app. Bug: 74711879 Test: manual PiperOrigin-RevId: 189371425 Change-Id: I14df55e2467be07dd30e3971004e601216f57daf
Diffstat (limited to 'java/com/android/dialer/main')
-rw-r--r--java/com/android/dialer/main/impl/MainSearchController.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/java/com/android/dialer/main/impl/MainSearchController.java b/java/com/android/dialer/main/impl/MainSearchController.java
index a614c7035..46f6a90b9 100644
--- a/java/com/android/dialer/main/impl/MainSearchController.java
+++ b/java/com/android/dialer/main/impl/MainSearchController.java
@@ -110,6 +110,15 @@ public class MainSearchController implements SearchBarListener {
/** Should be called if we're showing the dialpad because of a new ACTION_DIAL intent. */
public void showDialpadFromNewIntent() {
LogUtil.enterBlock("MainSearchController.showDialpadFromNewIntent");
+ if (isDialpadVisible()) {
+ // One scenario where this can happen is if the user has the dialpad open when the receive a
+ // call and press add call in the in call ui which calls this method.
+ LogUtil.i("MainSearchController.showDialpadFromNewIntent", "Dialpad is already visible.");
+
+ // Mark started from new intent in case there is a phone number in the intent
+ getDialpadFragment().setStartedFromNewIntent(true);
+ return;
+ }
showDialpad(/* animate=*/ false, /* fromNewIntent=*/ true);
}