@Test public void testSetScanSettings() throws Exception { Field scanSettingsField = mBleScanner.getClass().getDeclaredField("mScanSettings"); scanSettingsField.setAccessible(true); mBleScanner.setScanSettings(mMockScanSettings); assertThat("The scan settings is properly set", (ScanSettings) scanSettingsField.get(mBleScanner), is(mMockScanSettings)); }
public void setScanSettings(ScanSettings scanSettings) { if (scanSettings != null) { mScanSettings = scanSettings; Log.i(TAG, "setScanSettings: Mode: " + mScanSettings.getScanMode() + ", report delay in milliseconds: " + mScanSettings.getReportDelayMillis() + ", scan result type: " + mScanSettings.getScanResultType()); } else { throw new NullPointerException("The argument (ScanSettings) cannot be null"); } }
BleScanner extends ScanCallback { public void setScanSettings(ScanSettings scanSettings) { if (scanSettings != null) { mScanSettings = scanSettings; Log.i(TAG, "setScanSettings: Mode: " + mScanSettings.getScanMode() + ", report delay in milliseconds: " + mScanSettings.getReportDelayMillis() + ", scan result type: " + mScanSettings.getScanResultType()); } else { throw new NullPointerException("The argument (ScanSettings) cannot be null"); } } }
BleScanner extends ScanCallback { public void setScanSettings(ScanSettings scanSettings) { if (scanSettings != null) { mScanSettings = scanSettings; Log.i(TAG, "setScanSettings: Mode: " + mScanSettings.getScanMode() + ", report delay in milliseconds: " + mScanSettings.getReportDelayMillis() + ", scan result type: " + mScanSettings.getScanResultType()); } else { throw new NullPointerException("The argument (ScanSettings) cannot be null"); } } BleScanner(Listener listener, BluetoothAdapter bluetoothAdapter);  BleScanner(Listener listener, BluetoothAdapter bluetoothAdapter,
                      ScanSettings.Builder builder, DiscoveryManagerSettings settings); }
BleScanner extends ScanCallback { public void setScanSettings(ScanSettings scanSettings) { if (scanSettings != null) { mScanSettings = scanSettings; Log.i(TAG, "setScanSettings: Mode: " + mScanSettings.getScanMode() + ", report delay in milliseconds: " + mScanSettings.getReportDelayMillis() + ", scan result type: " + mScanSettings.getScanResultType()); } else { throw new NullPointerException("The argument (ScanSettings) cannot be null"); } } BleScanner(Listener listener, BluetoothAdapter bluetoothAdapter);  BleScanner(Listener listener, BluetoothAdapter bluetoothAdapter,
                      ScanSettings.Builder builder, DiscoveryManagerSettings settings); boolean isStarted(); synchronized boolean start(); synchronized void stop(boolean notifyStateChanged); void clearScanFilters(); void addScanFilter(ScanFilter scanFilter); void setScanSettings(ScanSettings scanSettings); @TargetApi(23) void applyAdditionalMarshmallowSettings(ScanSettings.Builder scanSettingsBuilder); @Override void onBatchScanResults(List<ScanResult> scanResults); @Override void onScanFailed(int errorCode); @Override void onScanResult(int callbackType, ScanResult scanResult); }
BleScanner extends ScanCallback { public void setScanSettings(ScanSettings scanSettings) { if (scanSettings != null) { mScanSettings = scanSettings; Log.i(TAG, "setScanSettings: Mode: " + mScanSettings.getScanMode() + ", report delay in milliseconds: " + mScanSettings.getReportDelayMillis() + ", scan result type: " + mScanSettings.getScanResultType()); } else { throw new NullPointerException("The argument (ScanSettings) cannot be null"); } } BleScanner(Listener listener, BluetoothAdapter bluetoothAdapter);  BleScanner(Listener listener, BluetoothAdapter bluetoothAdapter,
                      ScanSettings.Builder builder, DiscoveryManagerSettings settings); boolean isStarted(); synchronized boolean start(); synchronized void stop(boolean notifyStateChanged); void clearScanFilters(); void addScanFilter(ScanFilter scanFilter); void setScanSettings(ScanSettings scanSettings); @TargetApi(23) void applyAdditionalMarshmallowSettings(ScanSettings.Builder scanSettingsBuilder); @Override void onBatchScanResults(List<ScanResult> scanResults); @Override void onScanFailed(int errorCode); @Override void onScanResult(int callbackType, ScanResult scanResult);  }