summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothManager.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothManager.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothManager.java b/framework/java/android/bluetooth/BluetoothManager.java
index b1618cf328..e355a1c0a5 100644
--- a/framework/java/android/bluetooth/BluetoothManager.java
+++ b/framework/java/android/bluetooth/BluetoothManager.java
@@ -16,6 +16,8 @@
package android.bluetooth;
+import android.Manifest;
+import android.annotation.RequiresPermission;
import android.content.Context;
import android.os.RemoteException;
import android.util.Log;
@@ -89,6 +91,7 @@ public final class BluetoothManager {
* {@link BluetoothProfile#STATE_DISCONNECTED},
* {@link BluetoothProfile#STATE_DISCONNECTING}
*/
+ @RequiresPermission(Manifest.permission.BLUETOOTH)
public int getConnectionState(BluetoothDevice device, int profile) {
if (DBG) Log.d(TAG,"getConnectionState()");
@@ -117,6 +120,7 @@ public final class BluetoothManager {
* @param profile GATT or GATT_SERVER
* @return List of devices. The list will be empty on error.
*/
+ @RequiresPermission(Manifest.permission.BLUETOOTH)
public List<BluetoothDevice> getConnectedDevices(int profile) {
if (DBG) Log.d(TAG,"getConnectedDevices");
if (profile != BluetoothProfile.GATT && profile != BluetoothProfile.GATT_SERVER) {
@@ -161,6 +165,7 @@ public final class BluetoothManager {
* {@link BluetoothProfile#STATE_DISCONNECTING},
* @return List of devices. The list will be empty on error.
*/
+ @RequiresPermission(Manifest.permission.BLUETOOTH)
public List<BluetoothDevice> getDevicesMatchingConnectionStates(int profile, int[] states) {
if (DBG) Log.d(TAG,"getDevicesMatchingConnectionStates");