diff options
author | Brad Ebinger <breadley@google.com> | 2017-02-06 22:03:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-02-06 22:03:29 +0000 |
commit | ed839943e08c956ddd3fb74941e45bbb59343c8c (patch) | |
tree | 4e2d2bae07630e15b316b33fafea8e99a7a6583c /telecomm/java/android/telecom/RemoteConnectionService.java | |
parent | 006065fee4f1fd088808178b9e5c688782ac1173 (diff) | |
parent | cd6ccfd23c91b6a1288949e187a1d8896dedd7cd (diff) |
Merge "Framework fixes to support VoLTE conf calls via RemoteConnectionServices."
Diffstat (limited to 'telecomm/java/android/telecom/RemoteConnectionService.java')
-rw-r--r-- | telecomm/java/android/telecom/RemoteConnectionService.java | 25 |
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 |