Fully connect CallsManager with InCallController for outgoing calls.

Change-Id: Ic28fc5ea1e4a76be32fc7bd2d29f9690da959c96
diff --git a/src/com/android/telecomm/Call.java b/src/com/android/telecomm/Call.java
index 9f9a692..905fa6a 100644
--- a/src/com/android/telecomm/Call.java
+++ b/src/com/android/telecomm/Call.java
@@ -16,9 +16,11 @@
 
 package com.android.telecomm;
 
+import android.os.RemoteException;
 import android.telecomm.CallInfo;
 import android.telecomm.CallState;
 import android.telecomm.ICallService;
+import android.util.Log;
 
 import java.util.Date;
 
@@ -28,6 +30,7 @@
  *  connected etc).
  */
 final class Call {
+    private static final String TAG = Call.class.getSimpleName();
 
     /**
      * Unique identifier for the call as a UUID string.
@@ -129,6 +132,22 @@
         setCallService(null);
     }
 
+    /*
+     * Attempts to disconnect the call through the call service.
+     */
+    void disconnect() {
+        if (mCallService == null) {
+            Log.w(TAG, "disconnect() request on a call without a call service.");
+        } else {
+            try {
+                Log.i(TAG, "Send disconnect to call service for call with id " + mId);
+                mCallService.disconnect(mId);
+            } catch (RemoteException e) {
+                Log.e(TAG, "Disconnect attempt failed.", e);
+            }
+        }
+    }
+
     /**
      * @return An object containing read-only information about this call.
      */