b/10699042 show dialpad when connects to voice mail.

Also now "Use touch tone keypad" in the dialer works, and
it automatically un-holds if there's only once call and it's
on hold. (which was a regression too.)

Change-Id: Ic9b797487edf960efc43d16c18d08559ae349b2a
diff --git a/common/src/com/android/services/telephony/common/ICallHandlerService.aidl b/common/src/com/android/services/telephony/common/ICallHandlerService.aidl
index 0cbd9b9..c4f0961 100644
--- a/common/src/com/android/services/telephony/common/ICallHandlerService.aidl
+++ b/common/src/com/android/services/telephony/common/ICallHandlerService.aidl
@@ -67,7 +67,7 @@
     /**
      * Called when the system wants to bring the in-call UI into the foreground.
      */
-    void bringToForeground();
+    void bringToForeground(boolean showDialpad);
 
     void onPostDialWait(int callId, String remainingChars);
 }
diff --git a/src/com/android/phone/CallHandlerServiceProxy.java b/src/com/android/phone/CallHandlerServiceProxy.java
index 3c7b517..c1724d0 100644
--- a/src/com/android/phone/CallHandlerServiceProxy.java
+++ b/src/com/android/phone/CallHandlerServiceProxy.java
@@ -284,13 +284,13 @@
         }
     }
 
-    public void bringToForeground() {
+    public void bringToForeground(boolean showDialpad) {
         // only support this call if the service is already connected.
         synchronized (mServiceAndQueueLock) {
             if (mCallHandlerServiceGuarded != null && mCallModeler.hasLiveCall()) {
                 try {
-                    if (DBG) Log.d(TAG, "bringToForeground");
-                    mCallHandlerServiceGuarded.bringToForeground();
+                    if (DBG) Log.d(TAG, "bringToForeground: " + showDialpad);
+                    mCallHandlerServiceGuarded.bringToForeground(showDialpad);
                 } catch (RemoteException e) {
                     Log.e(TAG, "Exception handling bringToForeground", e);
                 }
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index c37fe07..1ce46b2 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -297,7 +297,7 @@
     }
 
     private boolean showCallScreenInternal(boolean specifyInitialDialpadState,
-                                           boolean initialDialpadState) {
+                                           boolean showDialpad) {
         if (!PhoneGlobals.sVoiceCapable) {
             // Never allow the InCallScreen to appear on data-only devices.
             return false;
@@ -308,7 +308,7 @@
         // If the phone isn't idle then go to the in-call screen
         long callingId = Binder.clearCallingIdentity();
 
-        mCallHandlerService.bringToForeground();
+        mCallHandlerService.bringToForeground(showDialpad);
 
         Binder.restoreCallingIdentity(callingId);
         return true;