From 24af7f1d52b6bd2fe4a709a80ce771d0fa9e28a4 Mon Sep 17 00:00:00 2001 From: Andrew Cheng Date: Wed, 19 Jan 2022 18:12:25 +0000 Subject: [PATCH] Make BluetoothPbapClient and select methods @SystemApi The BluetoothPbapClient class is currently @hide. This CL annotates it to @SystemApi. It also adds explicit @hide to all public class members that are not ready to be committed to at this time. New System APIs include: - ACTION_CONNECTION_STATE_CHANGED - getConnectedDevices - getConnectionPolicy - getConnectionState - getDevicesMatchingConnectionState - setConnectionPolicy Tag: #feature Bug: 206032807 Test: atest BluetoothInstrumentationTests Test: atest BluetoothHostTest Change-Id: I2ab72b4db10cd7195ae3bac65339205e203c5f5e --- core/api/system-current.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/api/system-current.txt b/core/api/system-current.txt index a8ef47e29d674..7e58470612d57 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -2120,6 +2120,15 @@ package android.bluetooth { field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED"; } + public final class BluetoothPbapClient implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile { + method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List getConnectedDevices(); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice); + method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List getDevicesMatchingConnectionStates(@NonNull int[]); + method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int); + field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pbapclient.profile.action.CONNECTION_STATE_CHANGED"; + } + public interface BluetoothProfile { field public static final int A2DP_SINK = 11; // 0xb field public static final int AVRCP_CONTROLLER = 12; // 0xc