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.
- Move the preference from developer to general settings
- Add a "do not ask again" button (with a warning), but only when the
permission check is triggered on startup
Introduce new Settings / User interface / Screenshots to optionally prevent screenshots and viewing on non-secure displays.
Toggling this setting requires a GB restart to become fully effective.
Add a new NotificationType for received text.
Add device specific settings to the printer coordinator, also add setting to print received text (defaults to on).
Don't start the foreground NotificationCollectorMonitorService unless enabled in the deprecated settings.
The notification service seems to be reliably kept alive by the OS without this workaround, and having a second foreground service is causing a second persistent notification for some users.