From cc5e14088c6bb34cb1cb5ec5bf0d67980ea7c8e4 Mon Sep 17 00:00:00 2001 From: KaiserBh Date: Wed, 20 Dec 2023 11:30:51 +1100 Subject: [PATCH] chore: set foreground service type for SyncDataJob Signed-off-by: KaiserBh --- .../main/java/eu/kanade/tachiyomi/data/sync/SyncDataJob.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncDataJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncDataJob.kt index de4f33fc5..3ea2551a0 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncDataJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncDataJob.kt @@ -1,6 +1,8 @@ package eu.kanade.tachiyomi.data.sync import android.content.Context +import android.content.pm.ServiceInfo +import android.os.Build import androidx.work.CoroutineWorker import androidx.work.ExistingPeriodicWorkPolicy import androidx.work.ExistingWorkPolicy @@ -47,6 +49,11 @@ class SyncDataJob(private val context: Context, workerParams: WorkerParameters) return ForegroundInfo( Notifications.ID_RESTORE_PROGRESS, notifier.showSyncProgress().build(), + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC + } else { + 0 + }, ) }