From 696dc1f08dc257722d2b2324db36cd4508ca08fc Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Thu, 20 Apr 2017 23:00:43 +0200 Subject: [PATCH] Attempt to fix reconnection not happening in some cases Fixes #530 --- .../freeyourgadget/gadgetbridge/service/btle/BtLEQueue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/BtLEQueue.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/BtLEQueue.java index 3c887bafa..1feff2946 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/BtLEQueue.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/btle/BtLEQueue.java @@ -225,7 +225,7 @@ public final class BtLEQueue { // alive (we do not close() it). Unfortunately we sometimes have problems // reconnecting automatically, so we try to fix this by re-creating mBluetoothGatt. // Not sure if this actually works without re-initializing the device... - if (status != 0) { + if (mBluetoothGatt != null) { if (!wasInitialized || !maybeReconnect()) { disconnect(); // ensure that we start over cleanly next time }