From dbdd7366ed328e9193a51d7402289898142db466 Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Mon, 26 Sep 2016 22:30:15 +0200 Subject: [PATCH] Reenable the lollipop LE scanner, but after the plain BT scanner --- .../gadgetbridge/activities/DiscoveryActivity.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java index 038f45411..f65a44022 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/DiscoveryActivity.java @@ -33,6 +33,7 @@ import org.slf4j.LoggerFactory; import java.util.ArrayList; +import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.adapter.DeviceCandidateAdapter; import nodomain.freeyourgadget.gadgetbridge.devices.DeviceCoordinator; @@ -63,7 +64,11 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC // continue with LE scan, if available if (isScanning == Scanning.SCANNING_BT) { checkAndRequestLocationPermission(); - startDiscovery(Scanning.SCANNING_BTLE); + if (GBApplication.isRunningLollipopOrLater()) { + startDiscovery(Scanning.SCANNING_NEW_BTLE); + } else { + startDiscovery(Scanning.SCANNING_BTLE); + } } else { discoveryFinished(); } @@ -261,12 +266,7 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC LOG.warn("Not starting discovery, because already scanning."); return; } - if (false && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - // does not work for @ashimokawa - startDiscovery(Scanning.SCANNING_NEW_BTLE); - } else { - startDiscovery(Scanning.SCANNING_BT); - } + startDiscovery(Scanning.SCANNING_BT); } private void startDiscovery(Scanning what) {