Make incoming calls work.

This is a CL of random changes. Ties of loose ends which were previously
commented and adds new wiring to connect all the pieces together.

After this CL, incoming calls are functional for call services.

Change-Id: I6fa1e70b816094587849329790236f9289ec260b
diff --git a/src/com/android/telecomm/CallServiceWrapper.java b/src/com/android/telecomm/CallServiceWrapper.java
index 5d2162a..bb9d649 100644
--- a/src/com/android/telecomm/CallServiceWrapper.java
+++ b/src/com/android/telecomm/CallServiceWrapper.java
@@ -24,6 +24,8 @@
 import android.telecomm.ICallServiceAdapter;
 import android.util.Log;
 
+import com.android.telecomm.ServiceBinder.BindCallback;
+
 /**
  * Wrapper for {@link ICallService}s, handles binding to {@link ICallService} and keeps track of
  * when the object can safely be unbound. Other classes should not use {@link ICallService} directly
@@ -149,6 +151,27 @@
     }
 
     /**
+     * Starts retrieval of details for an incoming call. Details are returned through the
+     * call-service adapter using the specified call ID. Upon failure, the specified error callback
+     * is invoked. Can be invoked even when the call service is unbound.
+     *
+     * @param callID The call ID used for the incoming call.
+     * @param errorCallback The callback invoked upon failure.
+     */
+    void retrieveIncomingCall(final String callId, final Runnable errorCallback) {
+        BindCallback callback = new BindCallback() {
+            @Override public void onSuccess() {
+                setIncomingCallId(callId);
+            }
+            @Override public void onFailure() {
+                errorCallback.run();
+            }
+        };
+
+        bind(callback);
+    }
+
+    /**
      * Cancels the incoming call for the specified call ID.
      * TODO(santoscordon): This method should be called by IncomingCallsManager when the incoming
      * call has failed.