diff options
| author | Jeff Sharkey <jsharkey@google.com> | 2021-04-19 17:23:20 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-04-19 17:23:20 +0000 |
| commit | 95b4e6a7f5e661fd1bdfd23944dc2e08524185dd (patch) | |
| tree | 3e49f64ac76aad60e3488d01b493cd531f913e1b /core/java/android/bluetooth/BluetoothHeadsetClient.java | |
| parent | 20ea7bab3949df08f7ebf65e970fa12565ba3365 (diff) | |
| parent | 655d691d65c6b55a28a9a751fa2515f502f9d585 (diff) | |
Merge "Add missing Bluetooth API permission enforcement." into sc-dev
Diffstat (limited to 'core/java/android/bluetooth/BluetoothHeadsetClient.java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothHeadsetClient.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothHeadsetClient.java b/core/java/android/bluetooth/BluetoothHeadsetClient.java index 5816500d2c37..eef42d1b2f34 100644 --- a/core/java/android/bluetooth/BluetoothHeadsetClient.java +++ b/core/java/android/bluetooth/BluetoothHeadsetClient.java @@ -1038,6 +1038,8 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * #EXTRA_AG_FEATURE_ATTACH_NUMBER_TO_VT}. This method invocation will fail silently when * feature is not supported.</p> */ + @RequiresBluetoothConnectPermission + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean getLastVoiceTagNumber(BluetoothDevice device) { if (DBG) log("getLastVoiceTagNumber()"); final IBluetoothHeadsetClient service = @@ -1059,6 +1061,8 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * Note: This is an internal function and shouldn't be exposed */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) + @RequiresBluetoothConnectPermission + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getAudioState(BluetoothDevice device) { if (VDBG) log("getAudioState"); final IBluetoothHeadsetClient service = @@ -1083,6 +1087,8 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * @param allowed if routing is allowed to the device Note: This is an internal function and * shouldn't be exposed */ + @RequiresBluetoothConnectPermission + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void setAudioRouteAllowed(BluetoothDevice device, boolean allowed) { if (VDBG) log("setAudioRouteAllowed"); final IBluetoothHeadsetClient service = @@ -1106,6 +1112,8 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * @return whether the command succeeded Note: This is an internal function and shouldn't be * exposed */ + @RequiresBluetoothConnectPermission + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean getAudioRouteAllowed(BluetoothDevice device) { if (VDBG) log("getAudioRouteAllowed"); final IBluetoothHeadsetClient service = |
