Class ShadowBluetoothLeScanner


  • @Implements(value=android.bluetooth.le.BluetoothLeScanner.class,
                minSdk=21)
    public class ShadowBluetoothLeScanner
    extends java.lang.Object
    Adds Robolectric support for BLE scanning.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<android.bluetooth.le.ScanCallback> getScanCallbacks()
      Returns all currently active ScanCallbacks.
      protected void startScan​(java.util.List<android.bluetooth.le.ScanFilter> filters, android.bluetooth.le.ScanSettings settings, android.bluetooth.le.ScanCallback callback)
      Tracks ongoing scans.
      protected void stopScan​(android.bluetooth.le.ScanCallback callback)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShadowBluetoothLeScanner

        public ShadowBluetoothLeScanner()
    • Method Detail

      • startScan

        @Implementation
        protected void startScan​(java.util.List<android.bluetooth.le.ScanFilter> filters,
                                 android.bluetooth.le.ScanSettings settings,
                                 android.bluetooth.le.ScanCallback callback)
        Tracks ongoing scans. Use getScanCallbacks() to get a list of any currently registered ScanCallbacks.
      • stopScan

        @Implementation
        protected void stopScan​(android.bluetooth.le.ScanCallback callback)
      • getScanCallbacks

        public java.util.Set<android.bluetooth.le.ScanCallback> getScanCallbacks()
        Returns all currently active ScanCallbacks.