Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run ReadingListSyncAdapter as expedited work #5063

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

Isira-Seneviratne
Copy link
Contributor

What does this do?

This PR updates the reading list sync worker to run as expedited work.

Why is this needed?

With this change, WorkManager configures the worker to start execution immediately. It also provides APIs to create/update the work notification.

Demo

Screen_recording_20241026_083731.webm

Android 5.0

@cooltey
Copy link
Collaborator

cooltey commented Nov 15, 2024

Thanks for the PR!

Not sure but I don't see the notification when I start or login the app. Does this work for manually syncing the list?

@Isira-Seneviratne
Copy link
Contributor Author

Isira-Seneviratne commented Nov 15, 2024

That might be due to how foreground notifications work on Android 12 and later:

"Devices that run Android 12 (API level 31) or higher provide a streamlined experience for short-running foreground services. On these devices, the system waits 10 seconds before showing the notification associated with a foreground service."

I'll update the PR to change the behavior.

@cooltey
Copy link
Collaborator

cooltey commented Dec 2, 2024

That might be due to how foreground notifications work on Android 12 and later:

"Devices that run Android 12 (API level 31) or higher provide a streamlined experience for short-running foreground services. On these devices, the system waits 10 seconds before showing the notification associated with a foreground service."

I'll update the PR to change the behavior.

Thanks. I am still not seeing the notification. My device is Samsung S24 with Android 14.

@Isira-Seneviratne
Copy link
Contributor Author

Isira-Seneviratne commented Dec 4, 2024

It might be because the syncing is usually too fast to show the notification on newer Android versions. I set a breakpoint for the update foreground info method on my Pixel 8 with Android 15 and the notification appeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants