Add plumbing for merge failures and renable button. (3/4)

The merge failure is not plumbed up through any layer that
can trap the callback and act on it.  The first part of this
fix is to create that plumbing.  Then we need to reenable the
merge button. At this point in time, we leverage the fact
that forcing the call to reassess its capabilities will poke
the InCallUI to reenable the merge button. In the future, we
should plumb the merge failure all the way to InCallUI and
not only handle the button but display UI to the user. The UI
is currently being displayed by CallNotifier which is the wrong
place. See b/20530631 for more details.

Bug: 20229905
Change-Id: I0355ada46b484c6db4bee656c77386dd61be5e1f
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
index 429f296..db815ba 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -59,6 +59,7 @@
     private static final int MSG_SET_CONFERENCEABLE_CONNECTIONS = 20;
     private static final int MSG_ADD_EXISTING_CONNECTION = 21;
     private static final int MSG_ON_POST_DIAL_CHAR = 22;
+    private static final int MSG_SET_CONFERENCE_MERGE_FAILED = 23;
 
     private final IConnectionServiceAdapter mDelegate;
 
@@ -220,6 +221,15 @@
                     }
                     break;
                 }
+                case MSG_SET_CONFERENCE_MERGE_FAILED: {
+                    SomeArgs args = (SomeArgs) msg.obj;
+                    try {
+                        mDelegate.setConferenceMergeFailed((String) args.arg1);
+                    } finally {
+                        args.recycle();
+                    }
+                    break;
+                }
             }
         }
     };
@@ -280,6 +290,13 @@
         }
 
         @Override
+        public void setConferenceMergeFailed(String callId) {
+            SomeArgs args = SomeArgs.obtain();
+            args.arg1 = callId;
+            mHandler.obtainMessage(MSG_SET_CONFERENCE_MERGE_FAILED, args).sendToTarget();
+        }
+
+        @Override
         public void setIsConferenced(String callId, String conferenceCallId) {
             SomeArgs args = SomeArgs.obtain();
             args.arg1 = callId;