mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
This change aims to improve the connection reliability on Even Realities
G1. It has a few changes:
1. Fixed a bug in MultiBLEDeviceSupport where if one devices "fails" to
connect because it is already connected, the other devices would be
skipped over.
2. Take the ConectionMonitor lock in G1 Device support when one of the
devices being disconnected is being handled, this prevents
reconnection or double disconnects overlapping leading to unexpected
state.
3. Add a hack when one side disconnects so that the global state of the
sub devices never passes through NOT_CONNECTED and instead moves
right from CONNECTED to WAITING_FOR_RECONNECT. This prevents the the
doubling of reconnection delay multiple times resulting in full 64
seconds reconnect attempts.
4. When one device disconnects, both BLE queues are now explicitly
disconnected. Previously just the device state was changed, which
meant reconnection was not always reliable.
5. Made the heart beat delay dynamic, when android low power mode kicks
in, the system may only check the timer expiration every 20 seconds.
Previously to get around this, the delay was set to a fixed 8
seconds, but this uses additional power when not in low power mode.
Now the thread will check the system added delay based on the time
since the last heartbeat and will schedule dymaically based on that.
The minimum delay is still 8 seconds, but now when batter saver is
not enabled, the delay will change to 25 seconds.
6. Fixed some nullptr exceptions when handling the device disconnection
when one device is not yet connected.