Show foreground notification right away when doing manual backup
This commit is contained in:
parent
594d5e17b5
commit
4b9e2bb9f3
1 changed files with 2 additions and 0 deletions
|
@ -15,6 +15,7 @@ import android.content.pm.PackageManager.NameNotFoundException
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.core.app.NotificationCompat.Action
|
import androidx.core.app.NotificationCompat.Action
|
||||||
import androidx.core.app.NotificationCompat.Builder
|
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_DEFAULT
|
||||||
import androidx.core.app.NotificationCompat.PRIORITY_HIGH
|
import androidx.core.app.NotificationCompat.PRIORITY_HIGH
|
||||||
import androidx.core.app.NotificationCompat.PRIORITY_LOW
|
import androidx.core.app.NotificationCompat.PRIORITY_LOW
|
||||||
|
@ -127,6 +128,7 @@ internal class BackupNotificationManager(private val context: Context) {
|
||||||
setWhen(System.currentTimeMillis())
|
setWhen(System.currentTimeMillis())
|
||||||
setProgress(expected, transferred, false)
|
setProgress(expected, transferred, false)
|
||||||
priority = PRIORITY_DEFAULT
|
priority = PRIORITY_DEFAULT
|
||||||
|
foregroundServiceBehavior = FOREGROUND_SERVICE_IMMEDIATE
|
||||||
}.build()
|
}.build()
|
||||||
nm.notify(NOTIFICATION_ID_OBSERVER, notification)
|
nm.notify(NOTIFICATION_ID_OBSERVER, notification)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue