Repository navigation
fix(service): prevent orphaned "processing action" notification - #2939
Open
Praveensenpai wants to merge 1 commit into
Open
Praveensenpai wants to merge 1 commit into
Praveensenpai wants to merge 1 commit into
Conversation
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
|
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2522.
When
MusicServiceinitializes or receives external commands, it callsstartForeground()posting a temporary ongoing notification withNOTIFICATION_ID = 101("Processing playback action…").LocalOnlyMediaNotificationProviderpreviously returnedMediaNotification(notification.notificationId, ...)which uses Media3's default notification ID (1001). Because the notification IDs differed:101.101remained stuck in the notification shade as an ongoing non-dismissible notification.Changes
LocalOnlyMediaNotificationProvider.createNotificationto returnMediaNotification(MusicService.NOTIFICATION_ID, localOnlyNotification)so Media3 replaces and clears notification101.MusicService.ktnoting thatNOTIFICATION_IDis shared withLocalOnlyMediaNotificationProvider.Testing