Merge branch 'lock-task-mode-set-ongoing-true' into dev

This commit is contained in:
BinTianqi
2025-12-21 20:54:03 +08:00

View File

@@ -47,6 +47,8 @@ class LockTaskService: Service() {
.setContentTitle(getText(R.string.lock_task_mode)) .setContentTitle(getText(R.string.lock_task_mode))
.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)
.setForegroundServiceBehavior(NotificationCompat.FOREGROUND_SERVICE_IMMEDIATE)
.build() .build()
ServiceCompat.startForeground( ServiceCompat.startForeground(
this, NotificationType.LockTaskMode.id, notification, this, NotificationType.LockTaskMode.id, notification,