diff options
author | Tyler Gunn <tgunn@google.com> | 2021-06-24 11:25:07 -0700 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2021-08-13 18:29:40 +0000 |
commit | fdc4bff3198fcaedfa29f45d92525c0351acd583 (patch) | |
tree | 62c14ae24d87859eae299d8f3b65435f6c9885e9 /telecomm/java/android/telecom/RemoteConnectionService.java | |
parent | 7949cf90ace42c1582ef8fdb93fd85d5ed4b7372 (diff) |
Fix issue when adding existing connections via remote connection services.
When an existing connection is added to represent an IMS conference
participant, it is added with an associated parent conference specified.
This was NOT passed along to the connection manager via the
RemoteConnectionService API since there is no equivalent API present for
that operation. To work around this, we stash the parent conference's
ID into the connection extras. We will use that later so that Telecom
can know which conference is the parent of this call.
Also, removing restriction in RemoteConnectionService which would ignore
conferences with no children. This assumption was incorrect for VOLTE
conferences since they will start with no children. As a consequence we
would ALWAYS skip adding IMS conferences to the connection manager, which
would mean that it had no way of knowing about the conference that the
existing connections are associated with.
Test: Manual test with connection manager APIS on live network; make
conference and verify that the correct objects are being created wrapped
by the connection manager.
Bug: 188420526
Change-Id: Ie58afed7a3b7eeaa7e329e80479d273e4c50ec82
Change-Id: I4250f9459c7a1b82936583a10e93d049fdfb4c5d
Diffstat (limited to 'telecomm/java/android/telecom/RemoteConnectionService.java')
-rw-r--r-- | telecomm/java/android/telecom/RemoteConnectionService.java | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/telecomm/java/android/telecom/RemoteConnectionService.java b/telecomm/java/android/telecom/RemoteConnectionService.java index bf6a6ef793ff..efe35d21c003 100644 --- a/telecomm/java/android/telecom/RemoteConnectionService.java +++ b/telecomm/java/android/telecom/RemoteConnectionService.java @@ -239,13 +239,9 @@ 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; - } + // We used to skip adding empty conferences; however in the world of IMS conference + // calls we need to add them to the remote connection service because they will always + // start with no participants. conference.setState(parcel.getState()); conference.setConnectionCapabilities(parcel.getConnectionCapabilities()); @@ -379,6 +375,8 @@ final class RemoteConnectionService { @Override public void addExistingConnection(String callId, ParcelableConnection connection, Session.Info sessionInfo) { + Log.i(RemoteConnectionService.this, "addExistingConnection: callId=%s, conn=%s", callId, + connection); String callingPackage = mOurConnectionServiceImpl.getApplicationContext(). getOpPackageName(); int callingTargetSdkVersion = mOurConnectionServiceImpl.getApplicationInfo() @@ -390,6 +388,20 @@ final class RemoteConnectionService { Bundle newExtras = new Bundle(); newExtras.putParcelable(Connection.EXTRA_REMOTE_PHONE_ACCOUNT_HANDLE, connection.getPhoneAccount()); + if (connection.getParentCallId() != null) { + RemoteConference parentConf = mConferenceById.get(connection.getParentCallId()); + // If there is a parent being set, we need to stash the conference ID here. + // Telephony can add an existing connection while specifying a parent conference. + // There is no equivalent version of that operation as part of the remote connection + // API, so we will stash the pre-defined parent's ID in the extras. When the + // connectionmanager copies over the extras from the remote connection to the + // actual one, it'll get passed to Telecom so that it can make the association. + if (parentConf != null) { + newExtras.putString(Connection.EXTRA_ADD_TO_CONFERENCE_ID, parentConf.getId()); + Log.i(this, "addExistingConnection: stash parent of %s as %s", + connection.getParentCallId(), parentConf.getId()); + } + } remoteConnection.putExtras(newExtras); mConnectionById.put(callId, remoteConnection); remoteConnection.registerCallback(new RemoteConnection.Callback() { |