CleanCacheWorker: Rename to CacheWorker for simplicity
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@ import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.aurora.store.data.work.CleanCacheWorker
|
||||
import com.aurora.store.data.work.CacheWorker
|
||||
import com.aurora.store.util.Preferences
|
||||
import com.aurora.store.util.Preferences.PREFERENCE_INTRO
|
||||
import com.aurora.store.util.Preferences.PREFERENCE_MIGRATION_VERSION
|
||||
@@ -38,7 +38,7 @@ class MigrationReceiver: BroadcastReceiver() {
|
||||
|
||||
// 58 -> 59
|
||||
if (currentVersion == 0) {
|
||||
CleanCacheWorker.scheduleAutomatedCacheCleanup(context)
|
||||
CacheWorker.scheduleAutomatedCacheCleanup(context)
|
||||
currentVersion++
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import kotlin.time.DurationUnit
|
||||
import kotlin.time.toDuration
|
||||
|
||||
@HiltWorker
|
||||
class CleanCacheWorker @AssistedInject constructor(
|
||||
class CacheWorker @AssistedInject constructor(
|
||||
@Assisted private val appContext: Context,
|
||||
@Assisted workerParams: WorkerParameters
|
||||
) : CoroutineWorker(appContext, workerParams) {
|
||||
@@ -29,7 +29,7 @@ class CleanCacheWorker @AssistedInject constructor(
|
||||
private const val CLEAN_CACHE_WORKER = "CLEAN_CACHE_WORKER"
|
||||
|
||||
fun scheduleAutomatedCacheCleanup(context: Context) {
|
||||
val periodicWorkRequest = PeriodicWorkRequestBuilder<CleanCacheWorker>(
|
||||
val periodicWorkRequest = PeriodicWorkRequestBuilder<CacheWorker>(
|
||||
repeatInterval = 1,
|
||||
repeatIntervalTimeUnit = HOURS,
|
||||
flexTimeInterval = 30,
|
||||
@@ -30,7 +30,7 @@ import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
|
||||
import com.aurora.extensions.isIgnoringBatteryOptimizations
|
||||
import com.aurora.extensions.isSAndAbove
|
||||
import com.aurora.store.R
|
||||
import com.aurora.store.data.work.CleanCacheWorker
|
||||
import com.aurora.store.data.work.CacheWorker
|
||||
import com.aurora.store.data.work.UpdateWorker
|
||||
import com.aurora.store.databinding.FragmentOnboardingBinding
|
||||
import com.aurora.store.util.PackageUtil
|
||||
@@ -147,7 +147,7 @@ class OnboardingFragment : Fragment(R.layout.fragment_onboarding) {
|
||||
|
||||
private fun finishOnboarding() {
|
||||
setupAutoUpdates()
|
||||
CleanCacheWorker.scheduleAutomatedCacheCleanup(requireContext())
|
||||
CacheWorker.scheduleAutomatedCacheCleanup(requireContext())
|
||||
save(PREFERENCE_INTRO, true)
|
||||
findNavController().navigate(
|
||||
OnboardingFragmentDirections.actionOnboardingFragmentToSplashFragment()
|
||||
|
||||
Reference in New Issue
Block a user