From a38ef176ab8461845ca919a5d6e529139948e722 Mon Sep 17 00:00:00 2001 From: Krunal Patel Date: Wed, 21 Dec 2022 22:19:29 +0530 Subject: [PATCH] Fix notification content action to open download fragment --- .../java/com/github/libretube/services/DownloadService.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/github/libretube/services/DownloadService.kt b/app/src/main/java/com/github/libretube/services/DownloadService.kt index 027ed46fc..ba1754325 100644 --- a/app/src/main/java/com/github/libretube/services/DownloadService.kt +++ b/app/src/main/java/com/github/libretube/services/DownloadService.kt @@ -325,10 +325,10 @@ class DownloadService : Service() { } private fun getNotificationBuilder(item: DownloadItem): NotificationCompat.Builder { - val flag = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - PendingIntent.FLAG_IMMUTABLE + val flags = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_CANCEL_CURRENT } else { - 0 + PendingIntent.FLAG_CANCEL_CURRENT } val activityIntent = @@ -338,7 +338,7 @@ class DownloadService : Service() { Intent(this@DownloadService, MainActivity::class.java).apply { putExtra("fragmentToOpen", "downloads") }, - flag + flags ) return NotificationCompat