Add API support for multi-endpoint.
This CL includes changes required to support multi-endpoint (see the design doc linked off the bug). Main changes include: - support for indicating if a call/connection is "external" to the device. - support for indicating if an external call can be pulled from the remote device to the local device. - API used to initiate a pull of a call external to the current device to the current device. - Made the "connection event" API public (was previously @hide); this will be used to support passing some error events involving pulling calls to the incall ui. - Added new InCallService metadata which will be used to determine if an InCallService wants to be informed of external calls. - New disconnect causes which will be used to expose the fact that a multi-endpoint call was answered elsewhere and that a call ended because it was pulled to another device. - New call log call types to indicate if calls were answered elsewhere or pulled to another device. Bug: 27458894 Change-Id: I423f64ff965b5e50194635a51868c327782db2a1
This commit is contained in:
@@ -212,12 +212,14 @@ public final class RemoteConnection {
|
||||
|
||||
/**
|
||||
* Handles a connection event propagated to this {@link RemoteConnection}.
|
||||
* <p>
|
||||
* Connection events originate from {@link Connection#sendConnectionEvent(String, Bundle)}.
|
||||
*
|
||||
* @param connection The {@code RemoteConnection} invoking this method.
|
||||
* @param event The connection event.
|
||||
* @hide
|
||||
* @param extras Extras associated with the event.
|
||||
*/
|
||||
public void onConnectionEvent(RemoteConnection connection, String event) {}
|
||||
public void onConnectionEvent(RemoteConnection connection, String event, Bundle extras) {}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -961,6 +963,20 @@ public final class RemoteConnection {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Instructs this {@link RemoteConnection} to pull itself to the local device.
|
||||
* <p>
|
||||
* See {@link Call#pullExternalCall()} for more information.
|
||||
*/
|
||||
public void pullExternalCall() {
|
||||
try {
|
||||
if (mConnected) {
|
||||
mConnectionService.pullExternalCall(mConnectionId);
|
||||
}
|
||||
} catch (RemoteException ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the audio state of this {@code RemoteConnection}.
|
||||
*
|
||||
@@ -1301,14 +1317,14 @@ public final class RemoteConnection {
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
void onConnectionEvent(final String event) {
|
||||
void onConnectionEvent(final String event, final Bundle extras) {
|
||||
for (CallbackRecord record : mCallbackRecords) {
|
||||
final RemoteConnection connection = this;
|
||||
final Callback callback = record.getCallback();
|
||||
record.getHandler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
callback.onConnectionEvent(connection, event);
|
||||
callback.onConnectionEvent(connection, event, extras);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user