Show foreground notification right away when doing manual backup

This commit is contained in:
Torsten Grote 2023-01-04 11:06:09 -03:00 committed by Chirayu Desai
parent 594d5e17b5
commit 4b9e2bb9f3

View file

@ -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)
}