Add new ConnectionEvent API (hide) to send a notification to Telecom

Connection event used to inform Telecom that it should play or stop
the on hold tone. This is used to play or stop a tone when the peer
puts the current call on hold.

BUG=25357778
Change-Id: I2669f8f5062449784a712b9dd28e576326fcc679
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
index 293dc11..a790914 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -62,6 +62,7 @@
     private static final int MSG_ON_POST_DIAL_CHAR = 22;
     private static final int MSG_SET_CONFERENCE_MERGE_FAILED = 23;
     private static final int MSG_SET_EXTRAS = 24;
+    private static final int MSG_ON_CONNECTION_EVENT = 25;
 
     private final IConnectionServiceAdapter mDelegate;
 
@@ -240,6 +241,15 @@
                         args.recycle();
                     }
                 }
+
+                case MSG_ON_CONNECTION_EVENT: {
+                    SomeArgs args = (SomeArgs) msg.obj;
+                    try {
+                        mDelegate.onConnectionEvent((String) args.arg1, (String) args.arg2);
+                    } finally {
+                        args.recycle();
+                    }
+                }
             }
         }
     };
@@ -419,6 +429,14 @@
             args.arg2 = extras;
             mHandler.obtainMessage(MSG_SET_EXTRAS, args).sendToTarget();
         }
+
+        @Override
+        public final void onConnectionEvent(String connectionId, String event) {
+            SomeArgs args = SomeArgs.obtain();
+            args.arg1 = connectionId;
+            args.arg2 = event;
+            mHandler.obtainMessage(MSG_ON_CONNECTION_EVENT, args).sendToTarget();
+        }
     };
 
     public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {