summaryrefslogtreecommitdiff
path: root/core/java/android/bluetooth/BluetoothMapClient.java
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2021-04-20 12:30:37 -0600
committerJeff Sharkey <jsharkey@android.com>2021-04-21 12:59:38 -0600
commitf459828358a7079d1e3bc67bb39d5d0c8be3e02c (patch)
tree200e96548fff5eb8a6433c09da67f168ff420bbd /core/java/android/bluetooth/BluetoothMapClient.java
parent1eb043a982c864ea83081cca500cf948c1cb05ff (diff)
Annotations for Bluetooth broadcast intents.
Recent work has been using Error Prone rules and annotations to reflect the current state of permission enforcement across the Bluetooth stack, and we're now in a position were we can add new permission enforcement that had been missing. We've currently standardized on saying that APIs that return device or Bluetooth state information (without sharing details about any particular remote Bluetooth device) do not need to be permission protected. Bug: 183626724 Test: ./build/soong/soong_ui.bash --make-mode Bluetooth RUN_ERROR_PRONE=true Change-Id: I53ac7a4fe1dea57316048c3cac4fa237b6ba3d38
Diffstat (limited to 'core/java/android/bluetooth/BluetoothMapClient.java')
-rw-r--r--core/java/android/bluetooth/BluetoothMapClient.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothMapClient.java b/core/java/android/bluetooth/BluetoothMapClient.java
index f20b533af045..d72081c0bac7 100644
--- a/core/java/android/bluetooth/BluetoothMapClient.java
+++ b/core/java/android/bluetooth/BluetoothMapClient.java
@@ -20,8 +20,10 @@ import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
+import android.annotation.SdkConstant;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
+import android.annotation.SdkConstant.SdkConstantType;
import android.app.PendingIntent;
import android.bluetooth.annotations.RequiresBluetoothConnectPermission;
import android.compat.annotation.UnsupportedAppUsage;
@@ -50,16 +52,27 @@ public final class BluetoothMapClient implements BluetoothProfile {
private static final boolean VDBG = Log.isLoggable(TAG, Log.VERBOSE);
/** @hide */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_CONNECTION_STATE_CHANGED =
"android.bluetooth.mapmce.profile.action.CONNECTION_STATE_CHANGED";
/** @hide */
+ @RequiresPermission(android.Manifest.permission.RECEIVE_SMS)
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_MESSAGE_RECEIVED =
"android.bluetooth.mapmce.profile.action.MESSAGE_RECEIVED";
/* Actions to be used for pending intents */
/** @hide */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_MESSAGE_SENT_SUCCESSFULLY =
"android.bluetooth.mapmce.profile.action.MESSAGE_SENT_SUCCESSFULLY";
/** @hide */
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_MESSAGE_DELIVERED_SUCCESSFULLY =
"android.bluetooth.mapmce.profile.action.MESSAGE_DELIVERED_SUCCESSFULLY";
@@ -68,6 +81,9 @@ public final class BluetoothMapClient implements BluetoothProfile {
*
* @hide
*/
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_MESSAGE_READ_STATUS_CHANGED =
"android.bluetooth.mapmce.profile.action.MESSAGE_READ_STATUS_CHANGED";
@@ -76,6 +92,9 @@ public final class BluetoothMapClient implements BluetoothProfile {
*
* @hide
*/
+ @RequiresBluetoothConnectPermission
+ @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
+ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_MESSAGE_DELETED_STATUS_CHANGED =
"android.bluetooth.mapmce.profile.action.MESSAGE_DELETED_STATUS_CHANGED";