Pass context to get WorkManager instance

This commit is contained in:
arkon
2020-03-07 13:00:58 -05:00
parent 52434819c3
commit 8b6268966e
7 changed files with 19 additions and 19 deletions

View File

@@ -62,9 +62,9 @@ class AboutController : SettingsController() {
onChange { newValue ->
val checked = newValue as Boolean
if (checked) {
UpdaterJob.setupTask()
UpdaterJob.setupTask(context)
} else {
UpdaterJob.cancelTask()
UpdaterJob.cancelTask(context)
}
true
}

View File

@@ -106,7 +106,7 @@ class SettingsBackupController : SettingsController() {
onChange { newValue ->
val interval = (newValue as String).toInt()
BackupCreatorJob.setupTask(interval)
BackupCreatorJob.setupTask(context, interval)
true
}
}

View File

@@ -87,7 +87,7 @@ class SettingsLibraryController : SettingsController() {
onChange { newValue ->
val interval = (newValue as String).toInt()
LibraryUpdateJob.setupTask(interval)
LibraryUpdateJob.setupTask(context, interval)
true
}
}
@@ -103,7 +103,7 @@ class SettingsLibraryController : SettingsController() {
onChange {
// Post to event looper to allow the preference to be updated.
Handler().post { LibraryUpdateJob.setupTask() }
Handler().post { LibraryUpdateJob.setupTask(context) }
true
}
}