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/RemoteConference.java b/telecomm/java/android/telecom/RemoteConference.java
index 095a88f..c2261c3 100644
--- a/telecomm/java/android/telecom/RemoteConference.java
+++ b/telecomm/java/android/telecom/RemoteConference.java
@@ -18,7 +18,9 @@
import com.android.internal.telecom.IConnectionService;
+import android.annotation.Nullable;
import android.annotation.SystemApi;
+import android.os.Bundle;
import android.os.Handler;
import android.os.RemoteException;
@@ -49,6 +51,7 @@
RemoteConference conference,
List<RemoteConnection> conferenceableConnections) {}
public void onDestroyed(RemoteConference conference) {}
+ public void onExtrasChanged(RemoteConference conference, @Nullable Bundle extras) {}
}
private final String mId;
@@ -65,6 +68,7 @@
private int mState = Connection.STATE_NEW;
private DisconnectCause mDisconnectCause;
private int mConnectionCapabilities;
+ private Bundle mExtras;
/** @hide */
RemoteConference(String id, IConnectionService connectionService) {
@@ -209,6 +213,21 @@
}
}
+ /** @hide */
+ void setExtras(final Bundle extras) {
+ mExtras = extras;
+ for (CallbackRecord<Callback> record : mCallbackRecords) {
+ final RemoteConference conference = this;
+ final Callback callback = record.getCallback();
+ record.getHandler().post(new Runnable() {
+ @Override
+ public void run() {
+ callback.onExtrasChanged(conference, extras);
+ }
+ });
+ }
+ }
+
/**
* Returns the list of {@link RemoteConnection}s contained in this conference.
*
@@ -238,6 +257,15 @@
}
/**
+ * Obtain the extras associated with this {@code RemoteConnection}.
+ *
+ * @return The extras for this connection.
+ */
+ public final Bundle getExtras() {
+ return mExtras;
+ }
+
+ /**
* Disconnects the conference call as well as the child {@link RemoteConnection}s.
*/
public void disconnect() {