Package org.robolectric.shadows
Class ShadowBluetoothLeScanner
java.lang.Object
org.robolectric.shadows.ShadowBluetoothLeScanner
@Implements(value=android.bluetooth.le.BluetoothLeScanner.class,
minSdk=21)
public class ShadowBluetoothLeScanner
extends Object
Adds Robolectric support for BLE scanning.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Encapsulates scan params passed toBluetoothAdapter
startScan methods. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns allShadowBluetoothLeScanner.ScanParams
s representing active scans.Returns all currently activeScanCallback
s.protected int
startScan
(List<ScanFilter> filters, ScanSettings settings, PendingIntent pendingIntent) Tracks ongoing scans.protected void
startScan
(List<ScanFilter> filters, ScanSettings settings, ScanCallback callback) Tracks ongoing scans.protected void
stopScan
(PendingIntent pendingIntent) protected void
stopScan
(ScanCallback callback)
-
Constructor Details
-
ShadowBluetoothLeScanner
public ShadowBluetoothLeScanner()
-
-
Method Details
-
startScan
@Implementation protected void startScan(List<ScanFilter> filters, ScanSettings settings, ScanCallback callback) Tracks ongoing scans. UsegetScanCallbacks()
to get a list of any currently registeredScanCallback
s. -
startScan
@Implementation(minSdk=26) protected int startScan(List<ScanFilter> filters, ScanSettings settings, PendingIntent pendingIntent) Tracks ongoing scans. UsegetScanCallbacks()
to get a list of any currently registeredScanCallback
s. -
stopScan
-
stopScan
-
getScanCallbacks
Returns all currently activeScanCallback
s. -
getActiveScans
Returns allShadowBluetoothLeScanner.ScanParams
s representing active scans.
-