From a57a8cc7ca07570893a4180bf5fe7fbdd5a40ebc Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Thu, 18 May 2023 14:16:44 +0200 Subject: [PATCH] Bangle.js: Fix location listener not being cleaned up when waiting for reconnect --- .../service/devices/banglejs/BangleJSDeviceSupport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java index 5b38c4c6b..84ca89776 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/banglejs/BangleJSDeviceSupport.java @@ -236,7 +236,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport { LOG.info("ACTION_DEVICE_CHANGED " + stateString); addReceiveHistory("\n================================================\nACTION_DEVICE_CHANGED "+stateString+" "+(new SimpleDateFormat("yyyy-mm-dd hh:mm:ss", Locale.US)).format(Calendar.getInstance().getTime())+"\n================================================\n"); } - if (gbDevice!=null && gbDevice.getState() == GBDevice.State.NOT_CONNECTED) { + if (gbDevice!=null && (gbDevice.getState() == GBDevice.State.NOT_CONNECTED || gbDevice.getState() == GBDevice.State.WAITING_FOR_RECONNECT)) { stopLocationUpdate(); } }