From 5e5feb6f125b03a556acd54522b125024be876fb Mon Sep 17 00:00:00 2001 From: Jays2Kings Date: Wed, 21 Jul 2021 17:36:25 -0400 Subject: [PATCH] clean out unused methods in AutoUpdaterJob --- .../tachiyomi/data/updater/AutoUpdaterJob.kt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AutoUpdaterJob.kt b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AutoUpdaterJob.kt index f6b56477d0..793edc0cb9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/updater/AutoUpdaterJob.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/updater/AutoUpdaterJob.kt @@ -1,11 +1,7 @@ package eu.kanade.tachiyomi.data.updater -import android.app.ActivityManager -import android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND -import android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_VISIBLE import android.content.Context import android.os.Build -import androidx.core.app.NotificationCompat import androidx.work.Constraints import androidx.work.CoroutineWorker import androidx.work.ExistingWorkPolicy @@ -13,9 +9,7 @@ import androidx.work.NetworkType import androidx.work.OneTimeWorkRequestBuilder import androidx.work.WorkManager import androidx.work.WorkerParameters -import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.preference.PreferencesHelper -import eu.kanade.tachiyomi.util.system.notificationManager import kotlinx.coroutines.coroutineScope import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.api.get @@ -43,17 +37,6 @@ class AutoUpdaterJob(private val context: Context, workerParams: WorkerParameter } } - fun foregrounded(): Boolean { - val appProcessInfo = ActivityManager.RunningAppProcessInfo() - ActivityManager.getMyMemoryState(appProcessInfo) - return appProcessInfo.importance == IMPORTANCE_FOREGROUND || appProcessInfo.importance == IMPORTANCE_VISIBLE - } - - fun NotificationCompat.Builder.update(block: NotificationCompat.Builder.() -> Unit) { - block() - context.notificationManager.notify(Notifications.ID_UPDATER, build()) - } - companion object { private const val TAG = "AutoUpdateRunner" const val ALWAYS = 0