Android Pie: Notifications delayed for minutes #1439

Open
opened 3 years ago by andyboeh · 5 comments
andyboeh commented 3 years ago

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:

Casio GB-5600B

Your android version is:

9.0

Your Gadgetbridge version is:

0.32.x with patches, see #1417

#### Before reporting a bug, please confirm the following: - [x] I have read the [wiki](https://github.com/Freeyourgadget/Gadgetbridge/wiki), and I didn't find a solution to my problem / an answer to my question. - [x] I have searched the [issues](https://github.com/Freeyourgadget/Gadgetbridge/issues), and I didn't find a solution to my problem / an answer to my question. - [x] If you upload an image or other content, please make sure you have read and understood the [github policies and terms of services](https://help.github.com/articles/github-terms-of-service/#1-responsibility-for-user-generated-content) #### 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: Casio GB-5600B #### Your android version is: 9.0 #### Your Gadgetbridge version is: 0.32.x with patches, see #1417
Owner

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.

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.
hughwilliams94 commented 3 years ago (Migrated from github.com)
Owner

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.

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.
Poster

@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
@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
Owner
You might enable power safe mode manually via adb without waiting: https://stackoverflow.com/questions/31533972/how-to-shift-device-in-doze-mode-android-preview-m-marshmallow
Poster

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.

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.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.