Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Periodic library sync can't start its foreground notification on Android 12+

Closed
#1,028 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
android, kotlin
Domain
mobile

Research direction

Start with the periodic MediaImportWorker and its setForeground call, then compare it with the expedited import work added in #1027 and the device steps in docs/testing/device-checks.md. First choose between handing off to the expedited unique work and dropping setForeground for background syncs, since the issue leaves that open. Done means the chosen path runs on API 31+ without ForegroundServiceStartNotAllowedException, verified on a device.

Written by the indexing model from the issue text.

Description

bug next-release

Follow-up to #1027. Sync now now runs as expedited WorkManager work with a dataSync foreground notification, but the periodic MediaImportWorker path is unchanged: it calls setForeground from a plain (non-expedited) periodic job, which Android 12+ refuses with ForegroundServiceStartNotAllowedException; the worker only logs it. Forcing the job 3x on an emulator (cmd jobscheduler run -f) showed no notification.

Consequence: a long periodic sync has no foreground protection and no progress notification on API 31+. Options: have the periodic worker hand off to the expedited unique import work, or accept no notification for background syncs and drop the setForeground call there. Needs a device check either way (docs/testing/device-checks.md has the #1027 lines).

Dominant language
Kotlin
Stars
229
Forks
28
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from timusus/Shuttle2

All issues in timusus/Shuttle2

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.