Merge "BluetoothAdapter: Extend getActiveDevice with LeAudio" am: a8c0faa120 am: f1fecf587c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1890537 Change-Id: I9fdce99506ef1fcc53ffc0afcfd23f57420e9c35
This commit is contained in:
@@ -2022,6 +2022,7 @@ public final class BluetoothAdapter {
|
|||||||
* {@link BluetoothProfile#HEADSET},
|
* {@link BluetoothProfile#HEADSET},
|
||||||
* {@link BluetoothProfile#A2DP},
|
* {@link BluetoothProfile#A2DP},
|
||||||
* {@link BluetoothProfile#HEARING_AID}
|
* {@link BluetoothProfile#HEARING_AID}
|
||||||
|
* {@link BluetoothProfile#LE_AUDIO}
|
||||||
* @return A list of active bluetooth devices
|
* @return A list of active bluetooth devices
|
||||||
* @throws IllegalArgumentException If profile is not one of {@link ActiveDeviceProfile}
|
* @throws IllegalArgumentException If profile is not one of {@link ActiveDeviceProfile}
|
||||||
* @hide
|
* @hide
|
||||||
@@ -2034,12 +2035,14 @@ public final class BluetoothAdapter {
|
|||||||
public @NonNull List<BluetoothDevice> getActiveDevices(@ActiveDeviceProfile int profile) {
|
public @NonNull List<BluetoothDevice> getActiveDevices(@ActiveDeviceProfile int profile) {
|
||||||
if (profile != BluetoothProfile.HEADSET
|
if (profile != BluetoothProfile.HEADSET
|
||||||
&& profile != BluetoothProfile.A2DP
|
&& profile != BluetoothProfile.A2DP
|
||||||
&& profile != BluetoothProfile.HEARING_AID) {
|
&& profile != BluetoothProfile.HEARING_AID
|
||||||
|
&& profile != BluetoothProfile.LE_AUDIO) {
|
||||||
Log.e(TAG, "Invalid profile param value in getActiveDevices");
|
Log.e(TAG, "Invalid profile param value in getActiveDevices");
|
||||||
throw new IllegalArgumentException("Profiles must be one of "
|
throw new IllegalArgumentException("Profiles must be one of "
|
||||||
+ "BluetoothProfile.A2DP, "
|
+ "BluetoothProfile.A2DP, "
|
||||||
+ "BluetoothProfile.HEARING_AID, or"
|
+ "BluetoothProfile.HEARING_AID, or"
|
||||||
+ "BluetoothProfile.HEARING_AID");
|
+ "BluetoothProfile.HEARING_AID"
|
||||||
|
+ "BluetoothProfile.LE_AUDIO");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
mServiceLock.readLock().lock();
|
mServiceLock.readLock().lock();
|
||||||
|
|||||||
Reference in New Issue
Block a user