summaryrefslogtreecommitdiff
path: root/telecomm/java/android/telecom/InCallService.java
diff options
context:
space:
mode:
authorHall Liu <hallliu@google.com>2017-11-07 17:59:28 -0800
committerHall Liu <hallliu@google.com>2017-11-09 15:54:50 -0800
commita98f58b5c1f40aac4f0bfb1500b60310c102480b (patch)
treef502c3b09dbadabddc966074df529f2d13411a3a /telecomm/java/android/telecom/InCallService.java
parent3ddf22e69cc329741b41b423a3b5d18d8c9e81aa (diff)
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
Diffstat (limited to 'telecomm/java/android/telecom/InCallService.java')
-rw-r--r--telecomm/java/android/telecom/InCallService.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/InCallService.java b/telecomm/java/android/telecom/InCallService.java
index e384d4696ab0..d558bbaea6d3 100644
--- a/telecomm/java/android/telecom/InCallService.java
+++ b/telecomm/java/android/telecom/InCallService.java
@@ -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;
@@ -377,6 +379,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}
* will have only one {@code Phone}, and this method will be called exactly once in the lifetime