Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down