From 4b9e2bb9f344b586da5a5e9838354e15a372a56e Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Wed, 4 Jan 2023 11:06:09 -0300 Subject: [PATCH] Show foreground notification right away when doing manual backup --- .../seedvault/ui/notification/BackupNotificationManager.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/stevesoltys/seedvault/ui/notification/BackupNotificationManager.kt b/app/src/main/java/com/stevesoltys/seedvault/ui/notification/BackupNotificationManager.kt index de754606..35b412fa 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/ui/notification/BackupNotificationManager.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/ui/notification/BackupNotificationManager.kt @@ -15,6 +15,7 @@ import android.content.pm.PackageManager.NameNotFoundException import android.util.Log import androidx.core.app.NotificationCompat.Action import androidx.core.app.NotificationCompat.Builder +import androidx.core.app.NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE import androidx.core.app.NotificationCompat.PRIORITY_DEFAULT import androidx.core.app.NotificationCompat.PRIORITY_HIGH import androidx.core.app.NotificationCompat.PRIORITY_LOW @@ -127,6 +128,7 @@ internal class BackupNotificationManager(private val context: Context) { setWhen(System.currentTimeMillis()) setProgress(expected, transferred, false) priority = PRIORITY_DEFAULT + foregroundServiceBehavior = FOREGROUND_SERVICE_IMMEDIATE }.build() nm.notify(NOTIFICATION_ID_OBSERVER, notification) }