mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-26 00:21:45 +01:00
Try to fix race condition when re-connecting
(Count down latch only if services have been discovered)
This commit is contained in:
parent
21eada4caa
commit
f0e8440e67
@ -265,9 +265,6 @@ public final class BtLEQueue {
|
||||
|
||||
mGbDevice.setState(newState);
|
||||
mGbDevice.sendDeviceUpdateIntent(mContext);
|
||||
if (mConnectionLatch != null && newState == State.CONNECTED) {
|
||||
mConnectionLatch.countDown();
|
||||
}
|
||||
}
|
||||
|
||||
public void disconnect() {
|
||||
@ -516,6 +513,9 @@ public final class BtLEQueue {
|
||||
// only propagate the successful event
|
||||
getCallbackToUse().onServicesDiscovered(gatt);
|
||||
}
|
||||
if (mConnectionLatch != null) {
|
||||
mConnectionLatch.countDown();
|
||||
}
|
||||
} else {
|
||||
LOG.warn("onServicesDiscovered received: " + status);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user