From 4619694a85ffe6e1605d3b79913b768dfdd5f9a9 Mon Sep 17 00:00:00 2001 From: Jakub Pawlowski Date: Fri, 18 Jun 2021 00:15:47 +0200 Subject: [PATCH] Bluetooth: fix comments on Volume Control Profile review Bug: 150670922 Test: compilation Merged-In: I72b36b77aa97aa9501d13ecdfe0b9b7f49bcce2c Change-Id: I72b36b77aa97aa9501d13ecdfe0b9b7f49bcce2c --- core/api/current.txt | 1 - core/api/system-current.txt | 1 + .../android/bluetooth/BluetoothProfile.java | 2 ++ .../bluetooth/BluetoothVolumeControl.java | 34 ------------------- 4 files changed, 3 insertions(+), 35 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 734d64f93d68a..536c118554587 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -9094,7 +9094,6 @@ package android.bluetooth { field public static final int STATE_CONNECTING = 1; // 0x1 field public static final int STATE_DISCONNECTED = 0; // 0x0 field public static final int STATE_DISCONNECTING = 3; // 0x3 - field public static final int VOLUME_CONTROL = 23; // 0x17 } public static interface BluetoothProfile.ServiceListener { diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 400601ff45707..675347085f095 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -1630,6 +1630,7 @@ package android.bluetooth { field public static final int PBAP_CLIENT = 17; // 0x11 field @Deprecated public static final int PRIORITY_OFF = 0; // 0x0 field @Deprecated public static final int PRIORITY_ON = 100; // 0x64 + field public static final int VOLUME_CONTROL = 23; // 0x17 } public final class BluetoothUuid { diff --git a/core/java/android/bluetooth/BluetoothProfile.java b/core/java/android/bluetooth/BluetoothProfile.java index d9791026ad6df..4d93c5c6b7de5 100644 --- a/core/java/android/bluetooth/BluetoothProfile.java +++ b/core/java/android/bluetooth/BluetoothProfile.java @@ -217,7 +217,9 @@ public interface BluetoothProfile { /** * Volume Control profile * + * @hide */ + @SystemApi int VOLUME_CONTROL = 23; /** diff --git a/core/java/android/bluetooth/BluetoothVolumeControl.java b/core/java/android/bluetooth/BluetoothVolumeControl.java index 4eb28ad399520..e5092833d7aed 100644 --- a/core/java/android/bluetooth/BluetoothVolumeControl.java +++ b/core/java/android/bluetooth/BluetoothVolumeControl.java @@ -107,7 +107,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose close(); } - /*package*/ @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) public void close() { mProfileConnector.disconnect(); @@ -211,23 +210,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose } } - /** - * Set priority of the profile - * - *

The device should already be paired. - * Priority can be one of {@link #PRIORITY_ON} or {@link #PRIORITY_OFF}, - * - * @param device Paired bluetooth device - * @param priority - * @return true if priority is set, false on error - * @hide - */ - @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) - public boolean setPriority(BluetoothDevice device, int priority) { - if (DBG) log("setPriority(" + device + ", " + priority + ")"); - return setConnectionPolicy(device, BluetoothAdapter.priorityToConnectionPolicy(priority)); - } - /** * Set connection policy of the profile * @@ -262,22 +244,6 @@ public final class BluetoothVolumeControl implements BluetoothProfile, AutoClose return false; } - /** - * Get the priority of the profile. - * - *

The priority can be any of: - * {@link #PRIORITY_OFF}, {@link #PRIORITY_ON}, {@link #PRIORITY_UNDEFINED} - * - * @param device Bluetooth device - * @return priority of the device - * @hide - */ - @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) - public int getPriority(BluetoothDevice device) { - if (VDBG) log("getPriority(" + device + ")"); - return BluetoothAdapter.connectionPolicyToPriority(getConnectionPolicy(device)); - } - /** * Get the connection policy of the profile. *