From 07de367476cb337f597880b6f73e8c53e9b2fd19 Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 9 Jun 2021 17:11:13 -0400 Subject: [PATCH] Revert "Set background job expedited policies" This reverts commit c69420373a7e61c1b4eea038447cff6f0409a201. Caused crashes in TachiyomiSY for some reason. Will have to redo this once we target Android 12. --- .../java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt | 4 ---- .../java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt | 4 ---- .../main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt | 4 ---- .../java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt | 4 ---- 4 files changed, 16 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt index 7938b4688..7953906d5 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/backup/BackupCreatorJob.kt @@ -3,8 +3,6 @@ package eu.kanade.tachiyomi.data.backup import android.content.Context import androidx.core.net.toUri import androidx.work.ExistingPeriodicWorkPolicy -import androidx.work.ExperimentalExpeditedWork -import androidx.work.OutOfQuotaPolicy import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager import androidx.work.Worker @@ -33,7 +31,6 @@ class BackupCreatorJob(private val context: Context, workerParams: WorkerParamet companion object { private const val TAG = "BackupCreator" - @ExperimentalExpeditedWork fun setupTask(context: Context, prefInterval: Int? = null) { val preferences = Injekt.get() val interval = prefInterval ?: preferences.backupInterval().get() @@ -44,7 +41,6 @@ class BackupCreatorJob(private val context: Context, workerParams: WorkerParamet 10, TimeUnit.MINUTES ) - .setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST) .addTag(TAG) .build() diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt index dcddce00a..1d605fe6a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt @@ -3,9 +3,7 @@ package eu.kanade.tachiyomi.data.library import android.content.Context import androidx.work.Constraints import androidx.work.ExistingPeriodicWorkPolicy -import androidx.work.ExperimentalExpeditedWork import androidx.work.NetworkType -import androidx.work.OutOfQuotaPolicy import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager import androidx.work.Worker @@ -31,7 +29,6 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet companion object { private const val TAG = "LibraryUpdate" - @ExperimentalExpeditedWork fun setupTask(context: Context, prefInterval: Int? = null) { val preferences = Injekt.get() val interval = prefInterval ?: preferences.libraryUpdateInterval().get() @@ -55,7 +52,6 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet 10, TimeUnit.MINUTES ) - .setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST) .addTag(TAG) .setConstraints(constraints) .build() diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt index 8abfc8566..8abfce7b2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/UpdaterJob.kt @@ -3,9 +3,7 @@ package eu.kanade.tachiyomi.data.updater import android.content.Context import androidx.work.Constraints import androidx.work.ExistingPeriodicWorkPolicy -import androidx.work.ExperimentalExpeditedWork import androidx.work.NetworkType -import androidx.work.OutOfQuotaPolicy import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager import androidx.work.Worker @@ -32,7 +30,6 @@ class UpdaterJob(private val context: Context, workerParams: WorkerParameters) : companion object { private const val TAG = "UpdateChecker" - @ExperimentalExpeditedWork fun setupTask(context: Context) { val constraints = Constraints.Builder() .setRequiredNetworkType(NetworkType.CONNECTED) @@ -44,7 +41,6 @@ class UpdaterJob(private val context: Context, workerParams: WorkerParameters) : 3, TimeUnit.HOURS ) - .setExpedited(OutOfQuotaPolicy.DROP_WORK_REQUEST) .addTag(TAG) .setConstraints(constraints) .build() diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt index bdd48252e..974b42827 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/ExtensionUpdateJob.kt @@ -6,9 +6,7 @@ import androidx.core.app.NotificationManagerCompat import androidx.work.Constraints import androidx.work.CoroutineWorker import androidx.work.ExistingPeriodicWorkPolicy -import androidx.work.ExperimentalExpeditedWork import androidx.work.NetworkType -import androidx.work.OutOfQuotaPolicy import androidx.work.PeriodicWorkRequestBuilder import androidx.work.WorkManager import androidx.work.WorkerParameters @@ -66,7 +64,6 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam companion object { private const val TAG = "ExtensionUpdate" - @ExperimentalExpeditedWork fun setupTask(context: Context, forceAutoUpdateJob: Boolean? = null) { val preferences = Injekt.get() val autoUpdateJob = forceAutoUpdateJob ?: preferences.automaticExtUpdates().get() @@ -81,7 +78,6 @@ class ExtensionUpdateJob(private val context: Context, workerParams: WorkerParam 1, TimeUnit.HOURS ) - .setExpedited(OutOfQuotaPolicy.DROP_WORK_REQUEST) .addTag(TAG) .setConstraints(constraints) .build()