Send DTMF tones for dialing call

Fallback to active call only if outgoing call is not present.

Bug: 18224969
Change-Id: Ic3238bf539fe2188dce8ed4010652a6fc26a6435
diff --git a/src/com/android/incallui/CallList.java b/src/com/android/incallui/CallList.java
index ed52071..40fcf53 100644
--- a/src/com/android/incallui/CallList.java
+++ b/src/com/android/incallui/CallList.java
@@ -211,6 +211,14 @@
         return retval;
     }
 
+    public Call getOutgoingOrActive() {
+        Call retval = getOutgoingCall();
+        if (retval == null) {
+            retval = getActiveCall();
+        }
+        return retval;
+    }
+
     /**
      * A call that is waiting for {@link PhoneAccount} selection
      */
diff --git a/src/com/android/incallui/DialpadPresenter.java b/src/com/android/incallui/DialpadPresenter.java
index d76e6e9..c4ee021 100644
--- a/src/com/android/incallui/DialpadPresenter.java
+++ b/src/com/android/incallui/DialpadPresenter.java
@@ -30,7 +30,7 @@
     public void onUiReady(DialpadUi ui) {
         super.onUiReady(ui);
         InCallPresenter.getInstance().addListener(this);
-        mCall = CallList.getInstance().getActiveCall();
+        mCall = CallList.getInstance().getOutgoingOrActive();
     }
 
     @Override
@@ -42,7 +42,7 @@
     @Override
     public void onStateChange(InCallPresenter.InCallState oldState,
             InCallPresenter.InCallState newState, CallList callList) {
-        mCall = callList.getActiveCall();
+        mCall = callList.getOutgoingOrActive();
         Log.d(this, "DialpadPresenter mCall = " + mCall);
     }