From 80d15573aff52b411b9b0aa8e567453df994c5da Mon Sep 17 00:00:00 2001 From: cpfeiffer Date: Thu, 10 Sep 2015 00:00:52 +0200 Subject: [PATCH] Avoid tiny window where a gatt callback of an operation could be unset --- .../freeyourgadget/gadgetbridge/service/btle/BtLEQueue.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 0c5a195f..f8d2a5dd 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 @@ -20,7 +20,6 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.LinkedBlockingQueue; -import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice.State; import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport; @@ -62,10 +61,10 @@ public final class BtLEQueue { while (!mDisposed && !mCrashed) { try { Transaction transaction = mTransactions.take(); - internalGattCallback.reset(); if (!isConnected()) { // TODO: request connection and initialization from the outside and wait until finished + internalGattCallback.reset(); // wait until the connection succeeds before running the actions // Note that no automatic connection is performed. This has to be triggered