fix: immediately reconfigure WorkManager when auto-update interval changes (#5564)
* Initial plan * fix: reconfigure WorkManager task when auto-update interval changes Agent-Logs-Url: https://github.com/2dust/v2rayNG/sessions/2fd439e4-ecb0-4594-a90f-fbfe1e81b021 Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
@@ -105,6 +105,15 @@ class SettingsActivity : BaseActivity() {
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
autoUpdateInterval?.setOnPreferenceChangeListener { _, newValue ->
|
||||
val interval = (newValue as? String)?.toLongEx()
|
||||
if (interval != null && autoUpdateCheck?.isChecked == true) {
|
||||
configureUpdateTask(interval)
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
mode?.setOnPreferenceChangeListener { pref, newValue ->
|
||||
val valueStr = newValue.toString()
|
||||
(pref as? ListPreference)?.let { lp ->
|
||||
|
||||
Reference in New Issue
Block a user