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:
@@ -427,6 +427,31 @@ public abstract class Connection extends Conferenceable {
|
||||
public static final String EXTRA_DISABLE_ADD_CALL =
|
||||
"android.telecom.extra.DISABLE_ADD_CALL";
|
||||
|
||||
/**
|
||||
* String connection extra key on a {@link Connection} or {@link Conference} which contains the
|
||||
* original Connection ID associated with the connection. Used in
|
||||
* {@link RemoteConnectionService} to track the Connection ID which was originally assigned to a
|
||||
* connection/conference added via
|
||||
* {@link ConnectionService#addExistingConnection(PhoneAccountHandle, Connection)} and
|
||||
* {@link ConnectionService#addConference(Conference)} APIs. This is important to pass to
|
||||
* Telecom for when it deals with RemoteConnections. When the ConnectionManager wraps the
|
||||
* {@link RemoteConnection} and {@link RemoteConference} and adds it to Telecom, there needs to
|
||||
* be a way to ensure that we don't add the connection again as a duplicate.
|
||||
* <p>
|
||||
* For example, the TelephonyCS calls addExistingConnection for a Connection with ID
|
||||
* {@code TelephonyCS@1}. The ConnectionManager learns of this via
|
||||
* {@link ConnectionService#onRemoteExistingConnectionAdded(RemoteConnection)}, and wraps this
|
||||
* in a new {@link Connection} which it adds to Telecom via
|
||||
* {@link ConnectionService#addExistingConnection(PhoneAccountHandle, Connection)}. As part of
|
||||
* this process, the wrapped RemoteConnection gets assigned a new ID (e.g. {@code ConnMan@1}).
|
||||
* The TelephonyCS will ALSO try to add the existing connection to Telecom, except with the
|
||||
* ID it originally referred to the connection as. Thus Telecom needs to know that the
|
||||
* Connection with ID {@code ConnMan@1} is really the same as {@code TelephonyCS@1}.
|
||||
* @hide
|
||||
*/
|
||||
public static final String EXTRA_ORIGINAL_CONNECTION_ID =
|
||||
"android.telecom.extra.ORIGINAL_CONNECTION_ID";
|
||||
|
||||
/**
|
||||
* Connection event used to inform Telecom that it should play the on hold tone. This is used
|
||||
* to play a tone when the peer puts the current call on hold. Sent to Telecom via
|
||||
|
||||
Reference in New Issue
Block a user