My Notification is not triggering the deleteIntent that was set to it once it's swiped away.
Android 11 introduced a new way of controlling music services via a Notification inside the Notification shade or better yet inside the quick controls.
Something changed in Android 11 with the internals off the Notification and it no longer triggers the Pending Intent that was set for the value of deleteIntent.
Testing the same code on Android 10 and Android 11 produces different results when dismissing the Notification. Android 10 send the Pending Intent, but Android 11 doesn't.
I didn't find any new updates to the Media Style Notification that would produce the same result.
NotificationCompat.Builder(context, "channel_name")
.apply {
.
.
setDeleteIntent(deletePendingIntent)
setStyle(androidx.media.app.NotificationCompat.MediaStyle()
.setMediaSession(activeMediaSession?.sessionToken)
.setShowActionsInCompactView(playButtonIndex))
.
.
NotificationManagerCompat.from(context).notify(123, this.build())
}
If anyone has any ideas or has ran into the same issue, I'm open to hear them!