Update Telecom APIs to include multi-hfp

* Add bluetooth devices to CallAudioState
* Add methods for specifying a bluetooth device to InCallService
* Add methods for specifying a bluetooth device to Connection (for
self-managed connections)

Bug: 64767509
Test: unit tests
Change-Id: I286b19b423dc2ee417dbc90eda7e8055b2da2444
This commit is contained in:
Hall Liu
2017-11-07 17:59:28 -08:00
parent 3ddf22e69c
commit a98f58b5c1
14 changed files with 188 additions and 23 deletions

View File

@@ -16,6 +16,7 @@
package android.telecom;
import android.bluetooth.BluetoothDevice;
import android.os.Bundle;
import android.os.RemoteException;
@@ -128,7 +129,22 @@ public final class InCallAdapter {
*/
public void setAudioRoute(int route) {
try {
mAdapter.setAudioRoute(route);
mAdapter.setAudioRoute(route, null);
} catch (RemoteException e) {
}
}
/**
* Request audio routing to a specific bluetooth device. Calling this method may result in
* the device routing audio to a different bluetooth device than the one specified. A list of
* available devices can be obtained via {@link CallAudioState#getSupportedBluetoothDevices()}
*
* @param bluetoothAddress The address of the bluetooth device to connect to, as returned by
* {@link BluetoothDevice#getAddress()}, or {@code null} if no device is preferred.
*/
public void requestBluetoothAudio(String bluetoothAddress) {
try {
mAdapter.setAudioRoute(CallAudioState.ROUTE_BLUETOOTH, bluetoothAddress);
} catch (RemoteException e) {
}
}