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
This commit is contained in:
Tyler Gunn
2016-10-17 15:48:19 -07:00
parent 73c46f0609
commit 2282bb97e7
5 changed files with 76 additions and 8 deletions

View File

@@ -1347,7 +1347,13 @@ public abstract class ConnectionService extends Service {
*/
private String addExistingConnectionInternal(PhoneAccountHandle handle, Connection connection) {
String id;
if (handle == null) {
if (connection.getExtras() != null && connection.getExtras()
.containsKey(Connection.EXTRA_ORIGINAL_CONNECTION_ID)) {
id = connection.getExtras().getString(Connection.EXTRA_ORIGINAL_CONNECTION_ID);
Log.d(this, "addExistingConnectionInternal - conn %s reusing original id %s",
connection.getTelecomCallId(), id);
} else if (handle == null) {
// If no phone account handle was provided, we cannot be sure the call ID is unique,
// so just use a random UUID.
id = UUID.randomUUID().toString();
@@ -1381,13 +1387,21 @@ public abstract class ConnectionService extends Service {
}
private String addConferenceInternal(Conference conference) {
String originalId = null;
if (conference.getExtras() != null && conference.getExtras()
.containsKey(Connection.EXTRA_ORIGINAL_CONNECTION_ID)) {
originalId = conference.getExtras().getString(Connection.EXTRA_ORIGINAL_CONNECTION_ID);
Log.d(this, "addConferenceInternal: conf %s reusing original id %s",
conference.getTelecomCallId(),
originalId);
}
if (mIdByConference.containsKey(conference)) {
Log.w(this, "Re-adding an existing conference: %s.", conference);
} else if (conference != null) {
// Conferences do not (yet) have a PhoneAccountHandle associated with them, so we
// cannot determine a ConnectionService class name to associate with the ID, so use
// a unique UUID (for now).
String id = UUID.randomUUID().toString();
String id = originalId == null ? UUID.randomUUID().toString() : originalId;
mConferenceById.put(id, conference);
mIdByConference.put(conference, id);
conference.addListener(mConferenceListener);