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,9 +16,11 @@
package android.telecom;
import android.annotation.NonNull;
import android.annotation.SdkConstant;
import android.annotation.SystemApi;
import android.app.Service;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.hardware.camera2.CameraManager;
import android.net.Uri;
@@ -376,6 +378,22 @@ public abstract class InCallService extends Service {
}
}
/**
* 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 if the
* bluetooth stack is unable to route audio to the requested device.
* 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()}.
*/
public final void requestBluetoothAudio(@NonNull String bluetoothAddress) {
if (mPhone != null) {
mPhone.requestBluetoothAudio(bluetoothAddress);
}
}
/**
* Invoked when the {@code Phone} has been created. This is a signal to the in-call experience
* to start displaying in-call information to the user. Each instance of {@code InCallService}