diff options
author | Jeff Sharkey <jsharkey@android.com> | 2021-04-20 12:30:37 -0600 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2021-04-21 12:59:38 -0600 |
commit | d7c55664839ca7e6237cd0ef0f36eb51a4ee7ae6 (patch) | |
tree | 39d443fcfc78b04e5c6b517e47e443ff5309ba69 /framework/java/android/bluetooth/BluetoothHidHost.java | |
parent | 69a12631db6e521d753211fedc7da3ac7d6e6f85 (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 'framework/java/android/bluetooth/BluetoothHidHost.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothHidHost.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHidHost.java b/framework/java/android/bluetooth/BluetoothHidHost.java index bef4472b4a..68a9d371d3 100644 --- a/framework/java/android/bluetooth/BluetoothHidHost.java +++ b/framework/java/android/bluetooth/BluetoothHidHost.java @@ -80,6 +80,8 @@ public final class BluetoothHidHost implements BluetoothProfile { /** * @hide */ + @RequiresBluetoothConnectPermission + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_PROTOCOL_MODE_CHANGED = "android.bluetooth.input.profile.action.PROTOCOL_MODE_CHANGED"; @@ -87,6 +89,8 @@ public final class BluetoothHidHost implements BluetoothProfile { /** * @hide */ + @RequiresBluetoothConnectPermission + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_HANDSHAKE = "android.bluetooth.input.profile.action.HANDSHAKE"; @@ -94,6 +98,8 @@ public final class BluetoothHidHost implements BluetoothProfile { /** * @hide */ + @RequiresBluetoothConnectPermission + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_REPORT = "android.bluetooth.input.profile.action.REPORT"; @@ -101,6 +107,8 @@ public final class BluetoothHidHost implements BluetoothProfile { /** * @hide */ + @RequiresBluetoothConnectPermission + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_VIRTUAL_UNPLUG_STATUS = "android.bluetooth.input.profile.action.VIRTUAL_UNPLUG_STATUS"; @@ -108,6 +116,8 @@ public final class BluetoothHidHost implements BluetoothProfile { /** * @hide */ + @RequiresBluetoothConnectPermission + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_IDLE_TIME_CHANGED = "android.bluetooth.input.profile.action.IDLE_TIME_CHANGED"; |