From 7579fa3425a7c8d0e9edae10a176ee58d82617e7 Mon Sep 17 00:00:00 2001 From: Alice Kuo Date: Thu, 6 May 2021 15:13:35 +0800 Subject: [PATCH] Unhide BluetoothProfile.LE_AUDIO and getGroupId for the App usage. This change contains two item, 1. public BluetoothProfile.LE_AUDIO that App can use BluetoothProfile.ServiceLister with LE Audio profile, such as HFP, A2DP and hearing aid profile. 2. public getGroupId API that App can use this api to identify which devices are in the same group Bug: 150670922 Test: Manual test Ignore-AOSP-First: prevent merge conflict Change-Id: I32865720a8195b7c5ae29411cd1f3de95e7fc9b5 --- core/api/current.txt | 2 ++ core/java/android/bluetooth/BluetoothLeAudio.java | 1 - core/java/android/bluetooth/BluetoothProfile.java | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index c3855ad78fbe9..959fe4f13bff1 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -9429,6 +9429,7 @@ package android.bluetooth { method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List getConnectedDevices(); method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice); method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List getDevicesMatchingConnectionStates(@NonNull int[]); + method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getGroupId(@NonNull android.bluetooth.BluetoothDevice); field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_LE_AUDIO_CONNECTION_STATE_CHANGED = "android.bluetooth.action.LE_AUDIO_CONNECTION_STATE_CHANGED"; } @@ -9453,6 +9454,7 @@ package android.bluetooth { field @Deprecated public static final int HEALTH = 3; // 0x3 field public static final int HEARING_AID = 21; // 0x15 field public static final int HID_DEVICE = 19; // 0x13 + field public static final int LE_AUDIO = 22; // 0x16 field public static final int SAP = 10; // 0xa field public static final int STATE_CONNECTED = 2; // 0x2 field public static final int STATE_CONNECTING = 1; // 0x1 diff --git a/core/java/android/bluetooth/BluetoothLeAudio.java b/core/java/android/bluetooth/BluetoothLeAudio.java index 9de27ff97fe54..c438dd34f813c 100644 --- a/core/java/android/bluetooth/BluetoothLeAudio.java +++ b/core/java/android/bluetooth/BluetoothLeAudio.java @@ -356,7 +356,6 @@ public final class BluetoothLeAudio implements BluetoothProfile, AutoCloseable { * earbud) * @param device LE Audio capable device * @return group id that this device currently belongs to - * @hide */ @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission diff --git a/core/java/android/bluetooth/BluetoothProfile.java b/core/java/android/bluetooth/BluetoothProfile.java index f9f65d09c1b5c..973ae3ce6bd82 100644 --- a/core/java/android/bluetooth/BluetoothProfile.java +++ b/core/java/android/bluetooth/BluetoothProfile.java @@ -208,7 +208,6 @@ public interface BluetoothProfile { /** * LE Audio Device * - * @hide */ int LE_AUDIO = 22;