mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-01 14:32:54 +01:00
Avoid tiny window where a gatt callback of an operation could be unset
This commit is contained in:
parent
c23905070c
commit
80d15573af
@ -20,7 +20,6 @@ import java.util.concurrent.BlockingQueue;
|
|||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
|
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice.State;
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice.State;
|
||||||
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport;
|
||||||
@ -62,10 +61,10 @@ public final class BtLEQueue {
|
|||||||
while (!mDisposed && !mCrashed) {
|
while (!mDisposed && !mCrashed) {
|
||||||
try {
|
try {
|
||||||
Transaction transaction = mTransactions.take();
|
Transaction transaction = mTransactions.take();
|
||||||
internalGattCallback.reset();
|
|
||||||
|
|
||||||
if (!isConnected()) {
|
if (!isConnected()) {
|
||||||
// TODO: request connection and initialization from the outside and wait until finished
|
// TODO: request connection and initialization from the outside and wait until finished
|
||||||
|
internalGattCallback.reset();
|
||||||
|
|
||||||
// wait until the connection succeeds before running the actions
|
// wait until the connection succeeds before running the actions
|
||||||
// Note that no automatic connection is performed. This has to be triggered
|
// Note that no automatic connection is performed. This has to be triggered
|
||||||
|
Loading…
Reference in New Issue
Block a user