createConnection fix and misc cleanup

This CL does the following:
  - update ConnectionServiceWrapper to use latest
    ParcelableConnection property names
  - revert part of Ihab's change to CallServiceNotifier to
    get SIM subscriptions working again

Bug: 17156304
Change-Id: I4d6f6829f8d77b928ade3c806c6262cc072d6361
diff --git a/src/com/android/telecomm/ConnectionServiceWrapper.java b/src/com/android/telecomm/ConnectionServiceWrapper.java
index f535267..264ee63 100644
--- a/src/com/android/telecomm/ConnectionServiceWrapper.java
+++ b/src/com/android/telecomm/ConnectionServiceWrapper.java
@@ -889,10 +889,7 @@
         if (connection.getState() == Connection.STATE_DISCONNECTED) {
             // A connection that begins in the DISCONNECTED state is an indication of
             // failure to connect; we handle all failures uniformly
-            removeCall(
-                    callId,
-                    connection.getFailureCode(),
-                    connection.getFailureMessage());
+            removeCall(callId, connection.getDisconnectCause(), connection.getDisconnectMessage());
         } else {
             // Successful connection
             if (mPendingResponses.containsKey(callId)) {
diff --git a/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java b/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
index 0688f3b..5fd75e5 100644
--- a/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
+++ b/tests/src/com/android/telecomm/testapps/CallServiceNotifier.java
@@ -96,6 +96,8 @@
         TelecommManager telecommManager =
                 (TelecommManager) context.getSystemService(Context.TELECOMM_SERVICE);
 
+        telecommManager.clearAccounts(context.getPackageName());
+
         telecommManager.registerPhoneAccount(PhoneAccount.builder()
                 .withAccountHandle(
                         new PhoneAccountHandle(
@@ -105,21 +107,22 @@
                 .withSubscriptionNumber("555-TEST")
                 .withCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER)
                 .withIconResId(R.drawable.stat_sys_phone_call)
-                .withLabel("Dummy Service")
-                .withShortDescription("a short description for the dummy service")
+                .withLabel("TelecommTestApp Call Provider")
+                .withShortDescription("a short description for the call provider")
                 .build());
 
         telecommManager.registerPhoneAccount(PhoneAccount.builder()
                 .withAccountHandle(
                         new PhoneAccountHandle(
-                                new ComponentName(context, TestConnectionManager.class),
+                                new ComponentName(context, TestConnectionService.class),
                                 SIM_SUBSCRIPTION_ID))
-                .withHandle(Uri.parse("tel:555-CMGR"))
-                .withSubscriptionNumber("555-CMGR")
-                .withCapabilities(PhoneAccount.CAPABILITY_CONNECTION_MANAGER)
+                .withHandle(Uri.parse("tel:555-TSIM"))
+                .withSubscriptionNumber("555-TSIM")
+                .withCapabilities(PhoneAccount.CAPABILITY_CALL_PROVIDER |
+                    PhoneAccount.CAPABILITY_SIM_SUBSCRIPTION)
                 .withIconResId(R.drawable.stat_sys_phone_call)
-                .withLabel("Dummy Connection Manager")
-                .withShortDescription("a short description for the dummy connection manager")
+                .withLabel("TelecommTestApp SIM Subscription")
+                .withShortDescription("a short description for the sim subscription")
                 .build());
 
         telecommManager.registerPhoneAccount(PhoneAccount.builder()
diff --git a/tests/src/com/android/telecomm/testapps/TestConnectionManager.java b/tests/src/com/android/telecomm/testapps/TestConnectionManager.java
index 69c5ea6..902ace7 100644
--- a/tests/src/com/android/telecomm/testapps/TestConnectionManager.java
+++ b/tests/src/com/android/telecomm/testapps/TestConnectionManager.java
@@ -181,7 +181,7 @@
     }
 
     private static void log(String msg) {
-        Log.w("telecomtestcs", "[TestConnectionService] " + msg);
+        Log.w("telecomtestcs", "[TestConnectionManager] " + msg);
     }
 
     @Override
@@ -200,7 +200,7 @@
             PhoneAccountHandle connectionManagerAccount,
             final ConnectionRequest request) {
         return new TestManagedConnection(
-                createRemoteOutgoingConnection(
+                createRemoteIncomingConnection(
                         request.getAccountHandle(),
                         request),
                 true);