From d0fc91676dc50d1bde2247599401d6509aa8068b Mon Sep 17 00:00:00 2001 From: calderwoodra Date: Fri, 16 Mar 2018 11:48:49 -0700 Subject: 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 --- java/com/android/dialer/main/impl/MainSearchController.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'java/com/android/dialer/main') 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); } -- cgit v1.2.3