File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
dfu/src/main/java/no/nordicsemi/android/dfu/internal/scanner Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,10 @@ public void run() {
89
89
/*
90
90
* Android 8.1 onwards, stops unfiltered BLE scanning on screen off. Therefore we must add a filter to
91
91
* get scan results in case the device screen is turned off as this may affect users wanting scan/connect to the device in background.
92
- * See {@linktourl https://android.googlesource.com/platform/packages/apps/Bluetooth/+/319aeae6f4ebd13678b4f77375d1804978c4a1e1
92
+ * See {@linktourl https://android.googlesource.com/platform/packages/apps/Bluetooth/+/319aeae6f4ebd13678b4f77375d1804978c4a1e1}
93
93
*/
94
94
final ScanSettings settings = new ScanSettings .Builder ().setScanMode (ScanSettings .SCAN_MODE_LOW_LATENCY ).build ();
95
- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .O_MR1 ) {
95
+ if (adapter . isOffloadedFilteringSupported () && Build .VERSION .SDK_INT >= Build .VERSION_CODES .O_MR1 ) {
96
96
final List <ScanFilter > filters = new ArrayList <>();
97
97
filters .add (new ScanFilter .Builder ().setDeviceAddress (mDeviceAddress ).build ());
98
98
filters .add (new ScanFilter .Builder ().setDeviceAddress (mDeviceAddressIncremented ).build ());
You can’t perform that action at this time.
0 commit comments