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

This commit is contained in:
Tyler Gunn
2017-05-25 19:33:58 +00:00
committed by Android (Google) Code Review
3 changed files with 80 additions and 2 deletions

View File

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