Android Pie: Notifications delayed for minutes
Before reporting a bug, please confirm the following:
- I have read the wiki, and I didn't find a solution to my problem / an answer to my question.
- I have searched the issues, and I didn't find a solution to my problem / an answer to my question.
- If you upload an image or other content, please make sure you have read and understood the github policies and terms of services
Your issue is:
I'm on Android Pie. After a few hours of phone idle, notifications are not immediately forwarded to the device. I'm still trying to debug this and I'm not entirely sure if it's GB-related or device-specific - I'm on my branch that integrates GATT server features in the BtLE Queue (#1417).
It seems, however, that the Thread holding the Queue simply stalls. Judging from the logs, it is woken up as required, the BLE action is triggered, but completion takes several minutes. Every request that happens inbetween is delayed, i.e. new notifications are added to the queue and take minutes to complete.
I'm currently testing the impact of disabling battery optimizations for Gadgetbridge. Unfortunately, the issue is hard to reproduce.
This might be related to #1149.
Your wearable device is:
Your android version is:
Your Gadgetbridge version is:
0.32.x with patches, see #1417
Would be great if some Pie users with different devices than the Casio could report their observations. Either there is indeed an issue with Android Pie or maybe it's the changes from #1417.
From the behavior changelog at https://developer.android.com/about/versions/pie/android-9.0-changes-all I couldn't find an obvious reason for the issue.
I am running Android Pie (ArrowOS custom ROM) and I haven't noticed any delay, sending debug notifications from GB is practically instant. I have an Amazfit Bip.
@hughwilliams94 thanks for testing, however, your phone has to be idle for a few hours (!) before this behavior is exhibited. Further, this does not affect debug notifications, since that wakes up the application. One way to test this is:
- Have the phone idle for a few hours, i.e. as much asleep as possible
- trigger a GB notification, preferably by a message or a phone call, i.e. without touching your phone prior to this
It might be a device-specific issue: The Casio device performs a BLE transaction every minute (I'll investigate later if this is really necessary) and I noticed that these transactions were delayed for several minutes because of doze mode. I disabled battery optmizations for GB and haven't noticed any issues since then.
Deleting a branch is permanent. It CANNOT be undone. Continue?