summaryrefslogtreecommitdiffstats
path: root/telecomm/java/android/telecom/ConnectionService.java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2014-10-30 14:27:48 -0700
committerTyler Gunn <tgunn@google.com>2014-10-30 14:27:48 -0700
commit4a57b9b59b74c97e559a301af0add13cd4c3331c (patch)
tree30f66ba4ddd516a95c08b8b370e8fe56698932cc /telecomm/java/android/telecom/ConnectionService.java
parent272e2f73bd825aa6b1db0a5b332effe8b84d7b8c (diff)
downloadframeworks_base-4a57b9b59b74c97e559a301af0add13cd4c3331c.zip
frameworks_base-4a57b9b59b74c97e559a301af0add13cd4c3331c.tar.gz
frameworks_base-4a57b9b59b74c97e559a301af0add13cd4c3331c.tar.bz2
Creating connections for conference event package participants.
- Add "addExistingConnection" method to connection service which provides a way for a connection service to notify telecom of a pre-existing connection (connections are normally created through telecom). - Modify TelephonyConferenceController to retrieve its state from a multiparty connection in the conference (in the case of IMS calls, this would be the ImsCall that manages the conference) instead of just taking the first one. Bug: 18057361 Change-Id: I26993aec54ecb0ce90ae6983fd3eed9d8d0a5773
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionService.java')
-rw-r--r--telecomm/java/android/telecom/ConnectionService.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java
index 649533e..6e41c33 100644
--- a/telecomm/java/android/telecom/ConnectionService.java
+++ b/telecomm/java/android/telecom/ConnectionService.java
@@ -822,6 +822,40 @@ public abstract class ConnectionService extends Service {
}
/**
+ * Adds a connection created by the {@link ConnectionService} and informs telecom of the new
+ * connection.
+ *
+ * @param phoneAccountHandle The phone account handle for the connection.
+ * @param connection The connection to add.
+ */
+ public final void addExistingConnection(PhoneAccountHandle phoneAccountHandle,
+ Connection connection) {
+
+ String id = addExistingConnectionInternal(connection);
+ if (id != null) {
+ List<String> emptyList = new ArrayList<>(0);
+
+ ParcelableConnection parcelableConnection = new ParcelableConnection(
+ phoneAccountHandle,
+ connection.getState(),
+ connection.getCallCapabilities(),
+ connection.getAddress(),
+ connection.getAddressPresentation(),
+ connection.getCallerDisplayName(),
+ connection.getCallerDisplayNamePresentation(),
+ connection.getVideoProvider() == null ?
+ null : connection.getVideoProvider().getInterface(),
+ connection.getVideoState(),
+ connection.isRingbackRequested(),
+ connection.getAudioModeIsVoip(),
+ connection.getStatusHints(),
+ connection.getDisconnectCause(),
+ emptyList);
+ mAdapter.addExistingConnection(id, parcelableConnection);
+ }
+ }
+
+ /**
* Returns all the active {@code Connection}s for which this {@code ConnectionService}
* has taken responsibility.
*
@@ -906,6 +940,12 @@ public abstract class ConnectionService extends Service {
public void onRemoteConferenceAdded(RemoteConference conference) {}
/**
+ * Called when an existing connection is added remotely.
+ * @param connection The existing connection which was added.
+ */
+ public void onRemoteExistingConnectionAdded(RemoteConnection connection) {}
+
+ /**
* @hide
*/
public boolean containsConference(Conference conference) {
@@ -917,6 +957,11 @@ public abstract class ConnectionService extends Service {
onRemoteConferenceAdded(remoteConference);
}
+ /** {@hide} */
+ void addRemoteExistingConnection(RemoteConnection remoteConnection) {
+ onRemoteExistingConnectionAdded(remoteConnection);
+ }
+
private void onAccountsInitialized() {
mAreAccountsInitialized = true;
for (Runnable r : mPreInitializationConnectionRequests) {
@@ -925,6 +970,18 @@ public abstract class ConnectionService extends Service {
mPreInitializationConnectionRequests.clear();
}
+ /**
+ * Adds an existing connection to the list of connections, identified by a new UUID.
+ *
+ * @param connection The connection.
+ * @return The UUID of the connection (e.g. the call-id).
+ */
+ private String addExistingConnectionInternal(Connection connection) {
+ String id = UUID.randomUUID().toString();
+ addConnection(id, connection);
+ return id;
+ }
+
private void addConnection(String callId, Connection connection) {
mConnectionById.put(callId, connection);
mIdByConnection.put(connection, callId);