summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/le/BluetoothLeScanner.java
diff options
context:
space:
mode:
authorJack He <siyuanh@google.com>2017-08-22 16:06:54 -0700
committerJack He <siyuanh@google.com>2017-08-24 19:09:48 +0000
commit910201beb0bde1dcf6b33e4ec5d1eb60042419d8 (patch)
tree9e7b8aa471daaed62a7e16a6b8cbd10a0a533e8a /framework/java/android/bluetooth/le/BluetoothLeScanner.java
parent931010f176faa894f06051c57290f7723dfbcd49 (diff)
Fix checkstyle errors (1/2)
* Automatic style corrections through IDE Bug: 63596319 Test: make checkbuild, no manual changes, no functional changes Change-Id: I2397d55abc34c9b7a9b748bec6137778df3421a7
Diffstat (limited to 'framework/java/android/bluetooth/le/BluetoothLeScanner.java')
-rw-r--r--framework/java/android/bluetooth/le/BluetoothLeScanner.java35
1 files changed, 19 insertions, 16 deletions
diff --git a/framework/java/android/bluetooth/le/BluetoothLeScanner.java b/framework/java/android/bluetooth/le/BluetoothLeScanner.java
index 1eac395bd0..41c4f5ad5d 100644
--- a/framework/java/android/bluetooth/le/BluetoothLeScanner.java
+++ b/framework/java/android/bluetooth/le/BluetoothLeScanner.java
@@ -74,6 +74,7 @@ public final class BluetoothLeScanner {
/**
* Optional extra indicating the callback type, which will be one of
* CALLBACK_TYPE_* constants in {@link ScanSettings}.
+ *
* @see ScanCallback#onScanResult(int, ScanResult)
*/
public static final String EXTRA_CALLBACK_TYPE = "android.bluetooth.le.extra.CALLBACK_TYPE";
@@ -162,13 +163,13 @@ public final class BluetoothLeScanner {
* specify on behalf of which application(s) the work is being done.
*
* @param workSource {@link WorkSource} identifying the application(s) for which to blame for
- * the scan.
+ * the scan.
* @param callback Callback used to deliver scan results.
* @hide
*/
@SystemApi
@RequiresPermission(allOf = {
- Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.UPDATE_DEVICE_STATS })
+ Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.UPDATE_DEVICE_STATS})
public void startScanFromSource(final WorkSource workSource, final ScanCallback callback) {
startScanFromSource(null, new ScanSettings.Builder().build(), workSource, callback);
}
@@ -180,22 +181,22 @@ public final class BluetoothLeScanner {
* @param filters {@link ScanFilter}s for finding exact BLE devices.
* @param settings Settings for the scan.
* @param workSource {@link WorkSource} identifying the application(s) for which to blame for
- * the scan.
+ * the scan.
* @param callback Callback used to deliver scan results.
* @hide
*/
@SystemApi
@RequiresPermission(allOf = {
- Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.UPDATE_DEVICE_STATS })
+ Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.UPDATE_DEVICE_STATS})
public void startScanFromSource(List<ScanFilter> filters, ScanSettings settings,
- final WorkSource workSource, final ScanCallback callback) {
+ final WorkSource workSource, final ScanCallback callback) {
startScan(filters, settings, workSource, callback, null, null);
}
private int startScan(List<ScanFilter> filters, ScanSettings settings,
- final WorkSource workSource, final ScanCallback callback,
- final PendingIntent callbackIntent,
- List<List<ResultStorageDescriptor>> resultStorages) {
+ final WorkSource workSource, final ScanCallback callback,
+ final PendingIntent callbackIntent,
+ List<List<ResultStorageDescriptor>> resultStorages) {
BluetoothLeUtils.checkAdapterStateOn(mBluetoothAdapter);
if (callback == null && callbackIntent == null) {
throw new IllegalArgumentException("callback is null");
@@ -218,11 +219,11 @@ public final class BluetoothLeScanner {
}
if (!isSettingsConfigAllowedForScan(settings)) {
return postCallbackErrorOrReturn(callback,
- ScanCallback.SCAN_FAILED_FEATURE_UNSUPPORTED);
+ ScanCallback.SCAN_FAILED_FEATURE_UNSUPPORTED);
}
if (!isHardwareResourcesAvailableForScan(settings)) {
return postCallbackErrorOrReturn(callback,
- ScanCallback.SCAN_FAILED_OUT_OF_HARDWARE_RESOURCES);
+ ScanCallback.SCAN_FAILED_OUT_OF_HARDWARE_RESOURCES);
}
if (!isSettingsAndFilterComboAllowed(settings, filters)) {
return postCallbackErrorOrReturn(callback,
@@ -285,7 +286,7 @@ public final class BluetoothLeScanner {
* will be delivered through the {@code callback}.
*
* @param callback Callback of the Bluetooth LE Scan, it has to be the same instance as the one
- * used to start scan.
+ * used to start scan.
*/
public void flushPendingScanResults(ScanCallback callback) {
BluetoothLeUtils.checkAdapterStateOn(mBluetoothAdapter);
@@ -486,12 +487,13 @@ public final class BluetoothLeScanner {
// Check null in case the scan has been stopped
synchronized (this) {
- if (mScannerId <= 0)
+ if (mScannerId <= 0) {
return;
+ }
}
Handler handler = new Handler(Looper.getMainLooper());
handler.post(new Runnable() {
- @Override
+ @Override
public void run() {
if (onFound) {
mScanCallback.onScanResult(ScanSettings.CALLBACK_TYPE_FIRST_MATCH,
@@ -510,8 +512,9 @@ public final class BluetoothLeScanner {
Log.d(TAG, "onScanManagerErrorCallback() - errorCode = " + errorCode);
}
synchronized (this) {
- if (mScannerId <= 0)
+ if (mScannerId <= 0) {
return;
+ }
}
postCallbackError(mScanCallback, errorCode);
}
@@ -549,11 +552,11 @@ public final class BluetoothLeScanner {
}
private boolean isSettingsAndFilterComboAllowed(ScanSettings settings,
- List <ScanFilter> filterList) {
+ List<ScanFilter> filterList) {
final int callbackType = settings.getCallbackType();
// If onlost/onfound is requested, a non-empty filter is expected
if ((callbackType & (ScanSettings.CALLBACK_TYPE_FIRST_MATCH
- | ScanSettings.CALLBACK_TYPE_MATCH_LOST)) != 0) {
+ | ScanSettings.CALLBACK_TYPE_MATCH_LOST)) != 0) {
if (filterList == null) {
return false;
}