Following up on some TODOs etc.

Change-Id: Ie5b11e85dd6415b89bb80791e0d3e834e77e35ca
diff --git a/src/com/android/telecomm/CallActivity.java b/src/com/android/telecomm/CallActivity.java
index 7fbb22d..1f1d778 100644
--- a/src/com/android/telecomm/CallActivity.java
+++ b/src/com/android/telecomm/CallActivity.java
@@ -29,7 +29,6 @@
 /**
  * Activity that handles system CALL actions and forwards them to {@link CallsManager}.
  * Handles all three CALL action types: CALL, CALL_PRIVILEGED, and CALL_EMERGENCY.
- * TODO(santoscordon): Connect with CallsManager.
  */
 public class CallActivity extends Activity {
 
diff --git a/src/com/android/telecomm/CallServiceAdapter.java b/src/com/android/telecomm/CallServiceAdapter.java
index bfbdebd..b75f487 100644
--- a/src/com/android/telecomm/CallServiceAdapter.java
+++ b/src/com/android/telecomm/CallServiceAdapter.java
@@ -60,10 +60,9 @@
     }
 
     /**
-     * TODO(santoscordon): Rename to handleIncomingCall.
      * {@inheritDoc}
      */
-    @Override public void newIncomingCall(CallInfo callInfo) {
+    @Override public void handleIncomingCall(CallInfo callInfo) {
         // TODO(santoscordon): fill in.
     }
 
diff --git a/src/com/android/telecomm/CallsManager.java b/src/com/android/telecomm/CallsManager.java
index 529137c..c96b8da 100644
--- a/src/com/android/telecomm/CallsManager.java
+++ b/src/com/android/telecomm/CallsManager.java
@@ -22,6 +22,7 @@
 import android.util.Log;
 
 import com.android.telecomm.exceptions.RestrictedCallException;
+
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
 import com.google.common.collect.Lists;
@@ -102,7 +103,8 @@
         }
 
         // No objection to issue the call, proceed with trying to put it through.
-        mSwitchboard.placeOutgoingCall(handle, contactInfo, context);
+        Call call = new Call(handle, contactInfo);
+        mSwitchboard.placeOutgoingCall(call, context);
     }
 
     /**
diff --git a/src/com/android/telecomm/InCallController.java b/src/com/android/telecomm/InCallController.java
index 435296b..b60b5cd 100644
--- a/src/com/android/telecomm/InCallController.java
+++ b/src/com/android/telecomm/InCallController.java
@@ -56,8 +56,8 @@
 
     /**
      * Package name of the in-call app. Although in-call code in kept in its own namespace, it is
-     * ultimately compiled into the dialer apk, hence the difference in namespaces between this and
-     * {@link IN_CALL_SERVICE_CLASS_NAME}.
+     * ultimately compiled into the dialer APK, hence the difference in namespaces between this and
+     * {@link #IN_CALL_SERVICE_CLASS_NAME}.
      * TODO(santoscordon): Change this into config.xml resource entry.
      */
     private static final String IN_CALL_PACKAGE_NAME = "com.google.android.dialer";
diff --git a/src/com/android/telecomm/OutgoingCallsManager.java b/src/com/android/telecomm/OutgoingCallsManager.java
index 27472f1..7eae0fa 100644
--- a/src/com/android/telecomm/OutgoingCallsManager.java
+++ b/src/com/android/telecomm/OutgoingCallsManager.java
@@ -16,13 +16,10 @@
 
 package com.android.telecomm;
 
-import android.os.RemoteException;
 import android.telecomm.ICallService;
 import android.telecomm.ICallServiceSelector;
 import android.util.Log;
 
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
 import com.google.common.collect.Maps;
 
 import java.util.List;
@@ -54,8 +51,8 @@
     /**
      * Starts the process of placing a call by constructing an outgoing call processor and asking
      * it to place the call. Upon success, execution will continue (via {@link CallServiceAdapter})
-     * to {@link #handleSuccessfulCall}. Upon failure, execution will return to
-     * {@link #handleFailedCall}.
+     * to {@link #handleSuccessfulCallAttempt}. Upon failure, execution will return to
+     * {@link #handleFailedCallAttempt}.
      *
      * @param call The call to place.
      * @param callServices The set of call services which can potentially place the call.
diff --git a/src/com/android/telecomm/Switchboard.java b/src/com/android/telecomm/Switchboard.java
index c78cefe..753f284 100644
--- a/src/com/android/telecomm/Switchboard.java
+++ b/src/com/android/telecomm/Switchboard.java
@@ -102,15 +102,12 @@
     /**
      * Attempts to place an outgoing call to the specified handle.
      *
-     * @param handle The handle to dial.
-     * @param contactInfo Information about the entity being called.
+     * @param call The yet-to-be-connected outgoing-call object.
      * @param context The application context.
      */
-    void placeOutgoingCall(String handle, ContactInfo contactInfo, Context context) {
+    void placeOutgoingCall(Call call, Context context) {
         ThreadUtil.checkOnMainThread();
 
-        // TODO(gilad): Consider creating the call object even earlier, e.g. in CallsManager.
-        Call call = new Call(handle, contactInfo);
         boolean bailout = false;
         if (isNullOrEmpty(mCallServices)) {
             mCallServiceFinder.initiateLookup(context);
@@ -262,70 +259,4 @@
     private boolean isNullOrEmpty(Collection collection) {
         return collection == null || collection.isEmpty();
     }
-
-    /**
-     * Places an outgoing call to the handle passed in. Given a list of {@link ICallServices},
-     * select one and place a call to the handle.
-     * TODO(santoscordon): How does the CallService selection process work?
-     * TODO(gilad): Wire this logic from CallServiceFinder.updateSwitchboard.
-     *
-     * @param handle The handle to dial.
-     * @param contactInfo Information about the entity being called.
-     * @param callServices The list of available {@link ICallService}s.
-     */
-//    private void placeOutgoingCallInternal(
-//            String handle,
-//            ContactInfo contactInfo,
-//            List<ICallService> callServices) throws CallServiceUnavailableException {
-//
-//        Log.i(TAG, "Placing and outgoing call.");
-//
-//        if (callServices.isEmpty()) {
-//            // No call services, bail out.
-//            // TODO(contacts-team): Add logging?
-//            // TODO(santoscordon): Does this actually go anywhere considering this method is now
-//            // asynchronous?
-//            throw new CallServiceUnavailableException("No CallService found.");
-//        }
-//
-//        List<ICallService> compatibleCallServices = Lists.newArrayList();
-//        for (ICallService service : callServices) {
-//            // TODO(santoscordon): This code needs to be updated to an asynchronous response
-//            // callback from isCompatibleWith().
-//            /* if (service.isCompatibleWith(handle)) {
-//                // NOTE(android-contacts): If we end up taking the liberty to issue
-//                // calls not using the explicit user input (in case one is provided)
-//                // and instead pull an alternative method of communication from the
-//                // specified user-info object, it may be desirable to give precedence
-//                // to services that can in fact respect the user's intent.
-//                compatibleCallServices.add(service);
-//            }
-//            */
-//        }
-//
-//        if (compatibleCallServices.isEmpty()) {
-//            // None of the available call services is suitable for making this call.
-//            // TODO(contacts-team): Same here re logging.
-//            throw new CallServiceUnavailableException("No compatible CallService found.");
-//        }
-//
-//        // NOTE(android-team): At this point we can also prompt the user for
-//        // preference, i.e. instead of the logic just below.
-//        if (compatibleCallServices.size() > 1) {
-//            compatibleCallServices = sort(compatibleCallServices);
-//        }
-//        for (ICallService service : compatibleCallServices) {
-//            try {
-//                service.call(handle);
-//                return;
-//            } catch (RemoteException e) {
-//                // TODO(santoscordon): Need some proxy for ICallService so that we don't have to
-//                // avoid RemoteExceptionHandling everywhere. Take a look at how InputMethodService
-//                // handles this.
-//            }
-//            // catch (OutgoingCallException ignored) {
-//            // TODO(santoscordon): Figure out how OutgoingCallException falls into this. Should
-//            // RemoteExceptions also be converted to OutgoingCallExceptions thrown by call()?
-//        }
-//    }
 }