summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/le/BluetoothLeScanner.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2015-04-23 17:10:21 -0700
committerAndre Eisenbach <eisenbach@google.com>2015-05-15 00:18:28 +0000
commit27ce6cfbe105e5c36e19b1f76bc9b8f29710b331 (patch)
tree508e37a1dbb58bf044a483f45e600afb3b00ada5 /framework/java/android/bluetooth/le/BluetoothLeScanner.java
parent038eab23e3c2350e6c9d3eda2904edd6e1767022 (diff)
Add bluetooth permission annotations
Change-Id: I5bc86f8ec6ea5c873f1e14dab0e0c47c5c9df7f7
Diffstat (limited to 'framework/java/android/bluetooth/le/BluetoothLeScanner.java')
-rw-r--r--framework/java/android/bluetooth/le/BluetoothLeScanner.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/le/BluetoothLeScanner.java b/framework/java/android/bluetooth/le/BluetoothLeScanner.java
index 687bd5db09..2e6c4f03d8 100644
--- a/framework/java/android/bluetooth/le/BluetoothLeScanner.java
+++ b/framework/java/android/bluetooth/le/BluetoothLeScanner.java
@@ -16,6 +16,8 @@
package android.bluetooth.le;
+import android.Manifest;
+import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothGatt;
@@ -80,6 +82,7 @@ public final class BluetoothLeScanner {
* @param callback Callback used to deliver scan results.
* @throws IllegalArgumentException If {@code callback} is null.
*/
+ @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
public void startScan(final ScanCallback callback) {
if (callback == null) {
throw new IllegalArgumentException("callback is null");
@@ -97,6 +100,7 @@ public final class BluetoothLeScanner {
* @param callback Callback used to deliver scan results.
* @throws IllegalArgumentException If {@code settings} or {@code callback} is null.
*/
+ @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
public void startScan(List<ScanFilter> filters, ScanSettings settings,
final ScanCallback callback) {
startScan(filters, settings, callback, null);
@@ -151,6 +155,7 @@ public final class BluetoothLeScanner {
*
* @param callback
*/
+ @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
public void stopScan(ScanCallback callback) {
BluetoothLeUtils.checkAdapterStateOn(mBluetoothAdapter);
synchronized (mLeScanClients) {