Disable dialpad chooser when the user selects "Add call".

As of change https://android-git.corp.google.com/g/59935 , an ACTION_DIAL
intent with no data now brings up the dialpad chooser if the phone is in
use.  This fixed a usability problem with the car home app.

Unfortunately an ACTION_DIAL intent with no data is *also* generated by
the InCallScreen's "Add call" button.  But we obviously *don't* want the
dialpad chooser in that use case, since the whole point of that button is
to add a 2nd call while the phone is already in use.

The fix is to check explicitly for the "Add call" action (using an intent
extra that already exists), and not show the dialpad chooser in that case.

Bug: 2878748
Change-Id: I890cfa72db375ff7b30fc8026da1bc9103118051
diff --git a/src/com/android/contacts/TwelveKeyDialer.java b/src/com/android/contacts/TwelveKeyDialer.java
index a16ca32..53c59f3 100644
--- a/src/com/android/contacts/TwelveKeyDialer.java
+++ b/src/com/android/contacts/TwelveKeyDialer.java
@@ -302,6 +302,7 @@
         if (Intent.ACTION_DIAL.equals(action) || Intent.ACTION_VIEW.equals(action)) {
             // see if we are "adding a call" from the InCallScreen; false by default.
             mIsAddCallMode = intent.getBooleanExtra(ADD_CALL_MODE_KEY, false);
+
             Uri uri = intent.getData();
             if (uri != null) {
                 if ("tel".equals(uri.getScheme())) {
@@ -325,10 +326,15 @@
                     }
                 }
             } else {
-                // Like ACTION_MAIN
-                // If there's already an active call, bring up an intermediate UI
-                // to make the user confirm what they really want to do.
-                needToShowDialpadChooser = phoneIsInUse();
+                // ACTION_DIAL or ACTION_VIEW with no data.
+                // This behaves basically like ACTION_MAIN: If there's
+                // already an active call, bring up an intermediate UI to
+                // make the user confirm what they really want to do.
+                // Be sure *not* to show the dialpad chooser if this is an
+                // explicit "Add call" action, though.
+                if (!mIsAddCallMode && phoneIsInUse()) {
+                    needToShowDialpadChooser = true;
+                }
             }
         } else if (Intent.ACTION_MAIN.equals(action)) {
             // The MAIN action means we're bringing up a blank dialer