mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
This change helps improve the connection experience when GadgetBridge is working as a background task. The glasses must be send a heartbeat packet every 32 seconds, otherwise they will disconnect. When GadgetBridge is running in the background there is a 15-20 second delay between the background handler waking up. This means that when the wake up time is sceduled for 30 seconds, it often won't be woken up for 45-50 seconds leading to almost immediate disconnect after the user turns off the screen. The official app gets around this by using a 5 second delay leading to ~25 seconds of delay in sleep mode, but this over sends when the phone is awake. Instead of doing that, I maintain the 28 second delay but I change the background thread to a higher priority so that it more consistently wakes up within th 32 second BLE limit. Also added support for Notifications being sent to the glasses.