summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/RemoteConnectionService.java
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2016-10-17 15:48:19 -0700
committerBrad Ebinger <breadley@google.com>2017-02-06 12:31:53 -0800
commitcd6ccfd23c91b6a1288949e187a1d8896dedd7cd (patch)
treee0f9c1032022ceb26b28f50b6d5ff8dfb8e981cf /telecomm/java/android/telecom/RemoteConnectionService.java
parentff1d8da55ed4dc7e646c970a401c869a47fc39e0 (diff)
Framework fixes to support VoLTE conf calls via RemoteConnectionServices.
Fixing some issues with the addExistingConnection and addConference APIs on ConnectionService. When a connection manager relays the addition of an existing connection or a conference to Telecom, it will assign a new ID to the new connection/conference. Due to how RemoteCSes work, the Connection/Conf will be added directly via TelephonyConnectionService and also via the connection manager's connection service. Because the ID changes, we ended up adding these twice. Conferences weren't a problem in the GSM conference case because the TElephonyConnectionService's ConnectionServiceWrapper didn't know of the IDs for the children of the conference. However, due to how the existing connections work its not the case for VoLTE conferences. To mitigate this, I'm passing the original connection/conference ID to the connection manager via extras (ugh) and using this to ensure that when the new existing connection/conference is added to telecom that the same ID is used. This ensures that we can properly de-dupe the requests from TelephonyConnectionService and the connection manager. Also, there was some missing code in RemoteConnectionService which would cause it to not properly track existing connections. Bug: 31464792 Change-Id: I436f4438fd000ea48ebea7ceb75105bd3f456e46
Diffstat (limited to 'telecomm/java/android/telecom/RemoteConnectionService.java')
-rw-r--r--telecomm/java/android/telecom/RemoteConnectionService.java25
1 files changed, 20 insertions, 5 deletions
diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java
index fe14003bca68..c65d5ef0b114 100644
--- a/telecomm/java/android/telecom/RemoteConnectionService.java
+++ b/telecomm/java/android/telecom/RemoteConnectionService.java
@@ -219,18 +219,27 @@ final class RemoteConnectionService {
conference.addConnection(c);
}
}
-
if (conference.getConnections().size() == 0) {
// A conference was created, but none of its connections are ones that have been
// created by, and therefore being tracked by, this remote connection service. It
// is of no interest to us.
+ Log.d(this, "addConferenceCall - skipping");
return;
}
conference.setState(parcel.getState());
conference.setConnectionCapabilities(parcel.getConnectionCapabilities());
conference.setConnectionProperties(parcel.getConnectionProperties());
+ conference.putExtras(parcel.getExtras());
mConferenceById.put(callId, conference);
+
+ // Stash the original connection ID as it exists in the source ConnectionService.
+ // Telecom will use this to avoid adding duplicates later.
+ // See comments on Connection.EXTRA_ORIGINAL_CONNECTION_ID for more information.
+ Bundle newExtras = new Bundle();
+ newExtras.putString(Connection.EXTRA_ORIGINAL_CONNECTION_ID, callId);
+ conference.putExtras(newExtras);
+
conference.registerCallback(new RemoteConference.Callback() {
@Override
public void onDestroyed(RemoteConference c) {
@@ -342,11 +351,17 @@ final class RemoteConnectionService {
@Override
public void addExistingConnection(String callId, ParcelableConnection connection,
Session.Info sessionInfo) {
- // TODO: add contents of this method
- RemoteConnection remoteConnction = new RemoteConnection(callId,
+ RemoteConnection remoteConnection = new RemoteConnection(callId,
mOutgoingConnectionServiceRpc, connection);
-
- mOurConnectionServiceImpl.addRemoteExistingConnection(remoteConnction);
+ mConnectionById.put(callId, remoteConnection);
+ remoteConnection.registerCallback(new RemoteConnection.Callback() {
+ @Override
+ public void onDestroyed(RemoteConnection connection) {
+ mConnectionById.remove(callId);
+ maybeDisconnectAdapter();
+ }
+ });
+ mOurConnectionServiceImpl.addRemoteExistingConnection(remoteConnection);
}
@Override