Add hangup support for OUTGOING/DIALING Calls.

Change-Id: I6c38df1c13986b4c34b1918353a8246c247becee
diff --git a/Android.mk b/Android.mk
index 261cb3f..a425dcc 100644
--- a/Android.mk
+++ b/Android.mk
@@ -7,7 +7,7 @@
 LOCAL_JAVA_LIBRARIES := telephony-common voip-common
 LOCAL_STATIC_JAVA_LIBRARIES := com.android.phone.shared \
         com.android.services.telephony.common \
-        guava
+        guava \
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 LOCAL_SRC_FILES += \
diff --git a/common/src/com/android/services/telephony/common/Call.java b/common/src/com/android/services/telephony/common/Call.java
index a3ba003..25ea085 100644
--- a/common/src/com/android/services/telephony/common/Call.java
+++ b/common/src/com/android/services/telephony/common/Call.java
@@ -21,7 +21,6 @@
 import android.os.Parcel;
 import android.os.Parcelable;
 
-import java.nio.Buffer;
 import java.util.Map;
 
 import com.android.internal.telephony.PhoneConstants;
diff --git a/src/com/android/phone/CallCommandService.java b/src/com/android/phone/CallCommandService.java
index 6a3848c..e5adb52 100644
--- a/src/com/android/phone/CallCommandService.java
+++ b/src/com/android/phone/CallCommandService.java
@@ -17,6 +17,7 @@
 package com.android.phone;
 
 import android.content.Context;
+import android.os.SystemProperties;
 import android.util.Log;
 
 import com.android.internal.telephony.CallManager;
@@ -30,8 +31,9 @@
  * Instances of this class are handed to in-call UI via CallMonitorService.
  */
 class CallCommandService extends ICallCommandService.Stub {
-
     private static final String TAG = CallCommandService.class.getSimpleName();
+    private static final boolean DBG =
+            (PhoneGlobals.DBG_LEVEL >= 1) && (SystemProperties.getInt("ro.debuggable", 0) == 1);
 
     private final Context mContext;
     private final CallManager mCallManager;
@@ -95,9 +97,12 @@
     public void disconnectCall(int callId) {
         try {
             CallResult result = mCallModeler.getCallWithId(callId);
+            if (DBG) Log.d(TAG, "disconnectCall " + result.getCall());
+
             if (result != null) {
                 int state = result.getCall().getState();
-                if (Call.State.ACTIVE == state || Call.State.ONHOLD == state) {
+                if (Call.State.ACTIVE == state || Call.State.ONHOLD == state ||
+                        Call.State.DIALING == state) {
                     result.getConnection().getCall().hangup();
                 }
             }