Merge "Add ability to add existing connection AND set parent at the same time." into oc-dev am: 95f4f14e0b

am: 0aea0d2c53

Change-Id: I76805ba85bfac39cdaa3ddd2b8340423e4c7ffbe
This commit is contained in:
Tyler Gunn
2017-05-25 19:55:00 +00:00
committed by android-build-merger
3 changed files with 80 additions and 2 deletions

View File

@@ -1842,10 +1842,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,
@@ -1866,7 +1884,8 @@ public abstract class ConnectionService extends Service {
connection.getStatusHints(),
connection.getDisconnectCause(),
emptyList,
connection.getExtras());
connection.getExtras(),
conferenceId);
mAdapter.addExistingConnection(id, parcelableConnection);
}
}