From 7d13e3280bdb960c71c8d8afccb2ca0c99288317 Mon Sep 17 00:00:00 2001 From: Praveensenpai Date: Sun, 25 Oct 2026 16:42:53 +0530 Subject: [PATCH] fix(service): stop orphaned "processing action" notification 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 #2522 --- .../data/service/LocalOnlyMediaNotificationProvider.kt | 4 +++- .../com/theveloper/pixelplay/data/service/MusicService.kt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/theveloper/pixelplay/data/service/LocalOnlyMediaNotificationProvider.kt b/app/src/main/java/com/theveloper/pixelplay/data/service/LocalOnlyMediaNotificationProvider.kt index f227bcd245..89b1eac9fe 100644 --- a/app/src/main/java/com/theveloper/pixelplay/data/service/LocalOnlyMediaNotificationProvider.kt +++ b/app/src/main/java/com/theveloper/pixelplay/data/service/LocalOnlyMediaNotificationProvider.kt @@ -44,7 +44,9 @@ class LocalOnlyMediaNotificationProvider( }.getOrElse { notification.notification } - return MediaNotification(notification.notificationId, localOnlyNotification) + // Same ID as MusicService's temporary foreground notification, so media updates + // replace it instead of leaving it behind as an orphaned notification. + return MediaNotification(MusicService.NOTIFICATION_ID, localOnlyNotification) } override fun handleCustomCommand( diff --git a/app/src/main/java/com/theveloper/pixelplay/data/service/MusicService.kt b/app/src/main/java/com/theveloper/pixelplay/data/service/MusicService.kt index adab461ca8..994863b2a1 100644 --- a/app/src/main/java/com/theveloper/pixelplay/data/service/MusicService.kt +++ b/app/src/main/java/com/theveloper/pixelplay/data/service/MusicService.kt @@ -257,6 +257,8 @@ class MusicService : MediaLibraryService() { companion object { private const val TAG = "MusicService_PixelPlay" + + /** Also used by [LocalOnlyMediaNotificationProvider]; the IDs must stay in sync. */ const val NOTIFICATION_ID = 101 const val ACTION_SLEEP_TIMER_EXPIRED = "com.theveloper.pixelplay.ACTION_SLEEP_TIMER_EXPIRED" const val EXTRA_FORCE_FOREGROUND_ON_START =