Basic wiring to hook up the call activity logic with calls manager.

Change-Id: I3bbd1401b933b353578d66168ce1bdf914b6f762
diff --git a/src/com/android/telecomm/CallsManager.java b/src/com/android/telecomm/CallsManager.java
index 99b68bd..a5fdcf7 100644
--- a/src/com/android/telecomm/CallsManager.java
+++ b/src/com/android/telecomm/CallsManager.java
@@ -6,11 +6,22 @@
 import java.util.ArrayList;
 import java.util.List;
 
-/** Singleton */
+/**
+ * Singleton.
+ *
+ * NOTE(gilad): by design most APIs are package private, use the relevant adapter/s to allow
+ * access from other packages specifically refraining from passing the CallsManager instance
+ * beyond the com.android.telecomm package boundary.
+ */
 public class CallsManager {
 
   private static final CallsManager INSTANCE = new CallsManager();
 
+  /**
+   * May be unnecessary per off-line discussions (between santoscordon and gilad) since the set
+   * of CallsManager APIs that need to be exposed to the dialer (or any application firing call
+   * intents) may be empty.
+   */
   private DialerAdapter dialerAdapter;
 
   private InCallAdapter inCallAdapter;
@@ -34,12 +45,10 @@
     voicemailManager = new VoicemailManager();  // As necessary etc.
   }
 
-  /** Package private */
   static CallsManager getInstance() {
     return INSTANCE;
   }
 
-  /** Package private */
   // TODO(gilad): Circle back to how we'd want to do this.
   void addCallService(CallService callService) {
     if (callService != null) {
@@ -48,15 +57,20 @@
     }
   }
 
-  /** Package private */
-  void connectTo(String userInput, ContactInfo contactInfo)
+  /**
+   * Attempts to issue/connect the specified call.  From an (arbitrary) application standpoint,
+   * all that is required to initiate this flow is to fire either of the CALL, CALL_PRIVILEGED,
+   * and CALL_EMERGENCY intents. These are listened to by CallActivity.java which then invokes
+   * this method.
+   */
+  void processOutgoingCallIntent(String handle, ContactInfo contactInfo)
       throws RestrictedCallException, CallServiceUnavailableException {
 
     for (OutgoingCallFilter policy : outgoingCallFilters) {
-      policy.validate(userInput, contactInfo);
+      policy.validate(handle, contactInfo);
     }
 
     // No objection to issue the call, proceed with trying to put it through.
-    switchboard.placeOutgoingCall(userInput, contactInfo);
+    switchboard.placeOutgoingCall(handle, contactInfo);
   }
 }