Merge "Fix issue when adding existing connections via remote connection services." into sc-dev
This commit is contained in:
@@ -774,6 +774,21 @@ public abstract class Connection extends Conferenceable {
|
|||||||
public static final String EXTRA_REMOTE_PHONE_ACCOUNT_HANDLE =
|
public static final String EXTRA_REMOTE_PHONE_ACCOUNT_HANDLE =
|
||||||
"android.telecom.extra.REMOTE_PHONE_ACCOUNT_HANDLE";
|
"android.telecom.extra.REMOTE_PHONE_ACCOUNT_HANDLE";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Telecom call ID of the conference an existing connection should be added to. This is
|
||||||
|
* required when {@link com.android.services.telephony.TelephonyConnectionService} adds a
|
||||||
|
* {@link Conference} to Telecom using the
|
||||||
|
* {@link ConnectionService#addExistingConnection(PhoneAccountHandle, Connection, Conference)}
|
||||||
|
* API. That API specifies a parent conference associated with the new existing connection
|
||||||
|
* being added, and there is no equivalent as part of the {@link RemoteConnectionService} API.
|
||||||
|
* This extra key is used to stack the ID of the conference to which the existing connection
|
||||||
|
* will be added so that Telecom can link it up correctly when the {@link RemoteConference}
|
||||||
|
* is added to Telecom by the connection manager.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final String EXTRA_ADD_TO_CONFERENCE_ID =
|
||||||
|
"android.telecom.extra.ADD_TO_CONFERENCE_ID";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extra key set from a {@link ConnectionService} when using the remote connection APIs
|
* Extra key set from a {@link ConnectionService} when using the remote connection APIs
|
||||||
* (e.g. {@link RemoteConnectionService#createRemoteConnection(PhoneAccountHandle,
|
* (e.g. {@link RemoteConnectionService#createRemoteConnection(PhoneAccountHandle,
|
||||||
|
|||||||
@@ -239,13 +239,9 @@ final class RemoteConnectionService {
|
|||||||
conference.addConnection(c);
|
conference.addConnection(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (conference.getConnections().size() == 0) {
|
// We used to skip adding empty conferences; however in the world of IMS conference
|
||||||
// A conference was created, but none of its connections are ones that have been
|
// calls we need to add them to the remote connection service because they will always
|
||||||
// created by, and therefore being tracked by, this remote connection service. It
|
// start with no participants.
|
||||||
// is of no interest to us.
|
|
||||||
Log.d(this, "addConferenceCall - skipping");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
conference.setState(parcel.getState());
|
conference.setState(parcel.getState());
|
||||||
conference.setConnectionCapabilities(parcel.getConnectionCapabilities());
|
conference.setConnectionCapabilities(parcel.getConnectionCapabilities());
|
||||||
@@ -379,6 +375,8 @@ final class RemoteConnectionService {
|
|||||||
@Override
|
@Override
|
||||||
public void addExistingConnection(String callId, ParcelableConnection connection,
|
public void addExistingConnection(String callId, ParcelableConnection connection,
|
||||||
Session.Info sessionInfo) {
|
Session.Info sessionInfo) {
|
||||||
|
Log.i(RemoteConnectionService.this, "addExistingConnection: callId=%s, conn=%s", callId,
|
||||||
|
connection);
|
||||||
String callingPackage = mOurConnectionServiceImpl.getApplicationContext().
|
String callingPackage = mOurConnectionServiceImpl.getApplicationContext().
|
||||||
getOpPackageName();
|
getOpPackageName();
|
||||||
int callingTargetSdkVersion = mOurConnectionServiceImpl.getApplicationInfo()
|
int callingTargetSdkVersion = mOurConnectionServiceImpl.getApplicationInfo()
|
||||||
@@ -390,6 +388,20 @@ final class RemoteConnectionService {
|
|||||||
Bundle newExtras = new Bundle();
|
Bundle newExtras = new Bundle();
|
||||||
newExtras.putParcelable(Connection.EXTRA_REMOTE_PHONE_ACCOUNT_HANDLE,
|
newExtras.putParcelable(Connection.EXTRA_REMOTE_PHONE_ACCOUNT_HANDLE,
|
||||||
connection.getPhoneAccount());
|
connection.getPhoneAccount());
|
||||||
|
if (connection.getParentCallId() != null) {
|
||||||
|
RemoteConference parentConf = mConferenceById.get(connection.getParentCallId());
|
||||||
|
// If there is a parent being set, we need to stash the conference ID here.
|
||||||
|
// Telephony can add an existing connection while specifying a parent conference.
|
||||||
|
// There is no equivalent version of that operation as part of the remote connection
|
||||||
|
// API, so we will stash the pre-defined parent's ID in the extras. When the
|
||||||
|
// connectionmanager copies over the extras from the remote connection to the
|
||||||
|
// actual one, it'll get passed to Telecom so that it can make the association.
|
||||||
|
if (parentConf != null) {
|
||||||
|
newExtras.putString(Connection.EXTRA_ADD_TO_CONFERENCE_ID, parentConf.getId());
|
||||||
|
Log.i(this, "addExistingConnection: stash parent of %s as %s",
|
||||||
|
connection.getParentCallId(), parentConf.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
remoteConnection.putExtras(newExtras);
|
remoteConnection.putExtras(newExtras);
|
||||||
mConnectionById.put(callId, remoteConnection);
|
mConnectionById.put(callId, remoteConnection);
|
||||||
remoteConnection.registerCallback(new RemoteConnection.Callback() {
|
remoteConnection.registerCallback(new RemoteConnection.Callback() {
|
||||||
|
|||||||
Reference in New Issue
Block a user