don't start scan if settings have not been set
@@ -157,7 +157,7 @@ public class CycledLeScannerForLollipop extends CycledLeScanner {
return;
}
List<ScanFilter> filters = new ArrayList<ScanFilter>();
- ScanSettings settings;
+ ScanSettings settings = null;
if (!mMainScanCycleActive) {
// Only scan between cycles if the between can cycle time > 6 seconds. A shorter low
@@ -170,15 +170,17 @@ public class CycledLeScannerForLollipop extends CycledLeScanner {
mBeaconManager.getBeaconParsers());
}
else {
- LogManager.d(TAG, "not scanning between cycles because the between scan cycle is too short.");
+ LogManager.d(TAG, "aborting scan between cycles because the between scan cycle is too short.");
}
} else {
LogManager.d(TAG, "starting non-filtered scan in SCAN_MODE_LOW_LATENCY");
settings = (new ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)).build();
}
+ if (settings != null) {
postStartLeScan(filters, settings);
}
+ }
@Override
protected void finishScan() {
