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

Chiusa
#1,028 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
android, kotlin
Ambito
mobile

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Kotlin
Stelle
233
Fork
28
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di timusus/Shuttle2

Tutte le issue di timusus/Shuttle2

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.