Skip to content

fix(service): stop orphaned "processing action" notification - #2936

Open
Mrslimek wants to merge 1 commit into
PixelPlayerHQ:masterfrom
Mrslimek:fix/stuck-processing-notification
Open

Mrslimek wants to merge 1 commit into
PixelPlayerHQ:masterfrom
Mrslimek:fix/stuck-processing-notification

Conversation

@Mrslimek

Copy link
Copy Markdown

MusicService posts a temporary foreground notification (ID 101) whenever the service is created or receives an external command. While playback is active the notification is intentionally left in place, assuming Media3 will replace it.

Media3 does not always call startForeground(): when no foreground start is required it posts its notification with notify() and detaches the service via stopForeground(false). With a different notification ID the temporary notification was neither replaced nor removed, leaving an ongoing, non-dismissible "Processing playback action..." notification next to the working media notification.

Use MusicService.NOTIFICATION_ID for the media notification as well, so every media update replaces the temporary notification and MediaNotificationManager.removeNotification() clears it.

Prepared with AI assistance; reviewed and verified on-device by me.

MusicService posts a temporary foreground notification (ID 101) whenever the service is created or receives an external command. While playback is active the notification is intentionally left in place, assuming Media3 will replace it.

Media3 does not always call startForeground(): when no foreground start is required it posts its notification with notify() and detaches the service via stopForeground(false). With a different notification ID the temporary notification was neither replaced nor removed, leaving an ongoing, non-dismissible "Processing playback action..." notification next to the working media notification.

Use MusicService.NOTIFICATION_ID for the media notification as well, so every media update replaces the temporary notification and MediaNotificationManager.removeNotification() clears it.
@georgesmirnoff1348

Copy link
Copy Markdown

cool bro! Thanks

@Praveensenpai

Copy link
Copy Markdown

Additional on-device verification for this fix (Samsung Galaxy S20 FE 5G, Android 13): started playback, backgrounded the app, then locked/unlocked the screen. Before the patch, an ongoing non-dismissible "Processing playback action…" notification remained alongside the media notification. With this change, the temporary notification (ID 101) is replaced by the media notification and cleared correctly — only the active media notification remains.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants