Add extras to Connections/Calls. (1/3)

Two major changes:
1) Add the notion of extras to a Connection.  These extras will be
parceled through to InCallService as Call.getExtras()
2) The previously existing Call.getExtras() has been renamed to
getIntentExtras(). This name better describes the fact that these
particular extras are from the original CALL or INCOMING_CALL intents.

Change-Id: I08c1baf4f08d54757f98012f0c08b423a707c53d
diff --git a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
index db815ba..293dc11 100644
--- a/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
+++ b/telecomm/java/android/telecom/ConnectionServiceAdapterServant.java
@@ -17,6 +17,7 @@
 package android.telecom;
 
 import android.net.Uri;
+import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
 import android.os.RemoteException;
@@ -60,6 +61,7 @@
     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 static final int MSG_SET_EXTRAS = 24;
 
     private final IConnectionServiceAdapter mDelegate;
 
@@ -230,6 +232,14 @@
                     }
                     break;
                 }
+                case MSG_SET_EXTRAS: {
+                    SomeArgs args = (SomeArgs) msg.obj;
+                    try {
+                        mDelegate.setExtras((String) args.arg1, (Bundle) args.arg2);
+                    } finally {
+                        args.recycle();
+                    }
+                }
             }
         }
     };
@@ -401,6 +411,14 @@
             args.arg2 = connection;
             mHandler.obtainMessage(MSG_ADD_EXISTING_CONNECTION, args).sendToTarget();
         }
+
+        @Override
+        public final void setExtras(String connectionId, Bundle extras) {
+            SomeArgs args = SomeArgs.obtain();
+            args.arg1 = connectionId;
+            args.arg2 = extras;
+            mHandler.obtainMessage(MSG_SET_EXTRAS, args).sendToTarget();
+        }
     };
 
     public ConnectionServiceAdapterServant(IConnectionServiceAdapter delegate) {