diff options
author | Tyler Gunn <tgunn@google.com> | 2017-05-09 14:34:57 -0700 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2017-05-24 15:15:44 -0700 |
commit | 78da7816da1acdb1cce3f4b5943d105c3383debe (patch) | |
tree | 6f50257f18e65981102981b9bcd76dd9ad4df04b /telecomm/java/android/telecom/ConnectionService.java | |
parent | e943a3cbe7dd9d7f1ab977e64178730190b37755 (diff) |
Add ability to add existing connection AND set parent at the same time.
This is useful for IMS conferences where we want to add a connection and
set it as a child of a conference at the same time.
Test: Manual
Bug: 37581781
Change-Id: Id09c8296ffe18893c5642d403c6a69ad6c9765e2
Diffstat (limited to 'telecomm/java/android/telecom/ConnectionService.java')
-rw-r--r-- | telecomm/java/android/telecom/ConnectionService.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index bf8f8e4e723e..d203d1949a06 100644 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -1770,10 +1770,28 @@ public abstract class ConnectionService extends Service { */ public final void addExistingConnection(PhoneAccountHandle phoneAccountHandle, Connection connection) { + addExistingConnection(phoneAccountHandle, connection, null /* conference */); + } + + /** + * Adds a connection created by the {@link ConnectionService} and informs telecom of the new + * connection. + * + * @param phoneAccountHandle The phone account handle for the connection. + * @param connection The connection to add. + * @param conference The parent conference of the new connection. + * @hide + */ + public final void addExistingConnection(PhoneAccountHandle phoneAccountHandle, + Connection connection, Conference conference) { String id = addExistingConnectionInternal(phoneAccountHandle, connection); if (id != null) { List<String> emptyList = new ArrayList<>(0); + String conferenceId = null; + if (conference != null) { + conferenceId = mIdByConference.get(conference); + } ParcelableConnection parcelableConnection = new ParcelableConnection( phoneAccountHandle, @@ -1794,7 +1812,8 @@ public abstract class ConnectionService extends Service { connection.getStatusHints(), connection.getDisconnectCause(), emptyList, - connection.getExtras()); + connection.getExtras(), + conferenceId); mAdapter.addExistingConnection(id, parcelableConnection); } } |