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/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 199100b..1e8ae88 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -21,6 +21,7 @@
 import android.content.ComponentName;
 import android.content.Intent;
 import android.net.Uri;
+import android.os.Bundle;
 import android.os.Handler;
 import android.os.IBinder;
 import android.os.Looper;
@@ -432,6 +433,12 @@
             String id = mIdByConference.get(conference);
             mAdapter.setStatusHints(id, statusHints);
         }
+
+        @Override
+        public void onExtrasChanged(Conference conference, Bundle extras) {
+            String id = mIdByConference.get(conference);
+            mAdapter.setExtras(id, extras);
+        }
     };
 
     private final Connection.Listener mConnectionListener = new Connection.Listener() {
@@ -569,6 +576,14 @@
                 mAdapter.onConferenceMergeFailed(id);
             }
         }
+
+        @Override
+        public void onExtrasChanged(Connection connection, Bundle extras) {
+            String id = mIdByConnection.get(connection);
+            if (id != null) {
+                mAdapter.setExtras(id, extras);
+            }
+        }
     };
 
     /** {@inheritDoc} */
@@ -638,7 +653,8 @@
                         connection.getAudioModeIsVoip(),
                         connection.getStatusHints(),
                         connection.getDisconnectCause(),
-                        createIdList(connection.getConferenceables())));
+                        createIdList(connection.getConferenceables()),
+                        connection.getExtras()));
     }
 
     private void abort(String callId) {
@@ -919,7 +935,8 @@
                             null : conference.getVideoProvider().getInterface(),
                     conference.getVideoState(),
                     conference.getConnectTimeMillis(),
-                    conference.getStatusHints());
+                    conference.getStatusHints(),
+                    conference.getExtras());
 
             mAdapter.addConferenceCall(id, parcelableConference);
             mAdapter.setVideoProvider(id, conference.getVideoProvider());
@@ -964,7 +981,8 @@
                     connection.getAudioModeIsVoip(),
                     connection.getStatusHints(),
                     connection.getDisconnectCause(),
-                    emptyList);
+                    emptyList,
+                    connection.getExtras());
             mAdapter.addExistingConnection(id, parcelableConnection);
         }
     }