mirror of
https://github.com/awfixers-stuff/OwnDroid.git
synced 2026-03-23 11:05:59 +00:00
fix: set NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE to avoid delays
This commit is contained in:
@@ -48,6 +48,7 @@ class LockTaskService: Service() {
|
|||||||
.setSmallIcon(R.drawable.lock_fill0)
|
.setSmallIcon(R.drawable.lock_fill0)
|
||||||
.addAction(NotificationCompat.Action.Builder(null, getString(R.string.stop), pendingIntent).build())
|
.addAction(NotificationCompat.Action.Builder(null, getString(R.string.stop), pendingIntent).build())
|
||||||
.setOngoing(true)
|
.setOngoing(true)
|
||||||
|
.setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE)
|
||||||
.build()
|
.build()
|
||||||
ServiceCompat.startForeground(
|
ServiceCompat.startForeground(
|
||||||
this, NotificationType.LockTaskMode.id, notification,
|
this, NotificationType.LockTaskMode.id, notification,
|
||||||
|
|||||||
Reference in New Issue
Block a user