Verify foreground playback starts from background-triggered runs #21

Open
opened 2026-09-16 21:54:50 +02:00 by morten-olsen · 0 comments
Owner

AudioPlaybackService.play catches a refused foreground-service start and falls back to a bare MediaPlayer, losing the
stop notification and reporting stopNotificationShown: false rather than failing the run.

That fallback is untested against a real background trigger. Workflows run inside PlatformEventWorker, a
CoroutineWorker, and PlatformEventDispatcher requests expedited work with RUN_AS_NON_EXPEDITED_WORK_REQUEST
fallback, so the Android 12+ exemption is not guaranteed once the expedited quota is exhausted.

Worth measuring how often the degraded path is actually taken for an SMS-triggered run with the app swapped out. If it is
common, the fix is probably for the worker to go foreground itself before starting playback, rather than accepting a
silent loss of the stop button.

`AudioPlaybackService.play` catches a refused foreground-service start and falls back to a bare `MediaPlayer`, losing the stop notification and reporting `stopNotificationShown: false` rather than failing the run. That fallback is **untested against a real background trigger**. Workflows run inside `PlatformEventWorker`, a `CoroutineWorker`, and `PlatformEventDispatcher` requests expedited work with `RUN_AS_NON_EXPEDITED_WORK_REQUEST` fallback, so the Android 12+ exemption is not guaranteed once the expedited quota is exhausted. Worth measuring how often the degraded path is actually taken for an SMS-triggered run with the app swapped out. If it is common, the fix is probably for the worker to go foreground itself before starting playback, rather than accepting a silent loss of the stop button.
Sign in to join this conversation.
No labels
bug
enhancement
feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
incubator/macros#21
No description provided.