Skip to content

fix(service): prevent orphaned "processing action" notification - #2939

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

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

Conversation

@Praveensenpai

Copy link
Copy Markdown

Summary

Fixes #2522.

When MusicService initializes or receives external commands, it calls startForeground() posting a temporary ongoing notification with NOTIFICATION_ID = 101 ("Processing playback action…").

LocalOnlyMediaNotificationProvider previously returned MediaNotification(notification.notificationId, ...) which uses Media3's default notification ID (1001). Because the notification IDs differed:

  • Media3's playback notification updates did not replace notification 101.
  • When the service or player cleared the media notification, notification 101 remained stuck in the notification shade as an ongoing non-dismissible notification.

Changes

  • Updated LocalOnlyMediaNotificationProvider.createNotification to return MediaNotification(MusicService.NOTIFICATION_ID, localOnlyNotification) so Media3 replaces and clears notification 101.
  • Added documentation in MusicService.kt noting that NOTIFICATION_ID is shared with LocalOnlyMediaNotificationProvider.

Testing

  • Tested and verified on a physical device (Samsung Galaxy S20 FE 5G, Android 13):
    • Started playback, backgrounded the app, and locked/unlocked the screen.
    • Confirmed the orphaned "Processing playback action…" notification is eliminated and only the active media player notification is present.

MusicService posts a temporary foreground notification (ID 101) when created. Media3 posts its playback notification using its own default ID, leaving notification 101 orphaned in the shade as an ongoing, non-dismissible notification.

Use MusicService.NOTIFICATION_ID for the media notification so updates replace the temporary notification and clearing it dismisses the notification.

Fixes PixelPlayerHQ#2522
@Mrslimek

Copy link
Copy Markdown

Hey! I noticed your PR is identical to my #2936. Since you've also tested the fix on your device, could you share your testing results in my PR instead, so we can avoid having duplicate PRs? Thanks!

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.

[Bug]: Processing playback action notification

2 participants