Show storage backup notification immediately

This commit is contained in:
Torsten Grote 2021-10-08 13:48:12 -03:00 committed by Chirayu Desai
parent 97398f1c5c
commit b184f208c4

View file

@ -9,6 +9,7 @@ import android.content.Context
import androidx.annotation.DrawableRes import androidx.annotation.DrawableRes
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.core.app.NotificationCompat import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE
import androidx.core.app.NotificationCompat.PRIORITY_DEFAULT import androidx.core.app.NotificationCompat.PRIORITY_DEFAULT
import org.calyxos.backup.storage.R import org.calyxos.backup.storage.R
@ -143,6 +144,7 @@ internal class Notifications(private val context: Context) {
setShowWhen(false) setShowWhen(false)
setWhen(System.currentTimeMillis()) setWhen(System.currentTimeMillis())
setProgress(expected, transferred, expected == 0) setProgress(expected, transferred, expected == 0)
foregroundServiceBehavior = FOREGROUND_SERVICE_IMMEDIATE
priority = PRIORITY_DEFAULT priority = PRIORITY_DEFAULT
}.build() }.build()