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:
Copilot
2026-04-27 20:59:02 +08:00
committed by GitHub
parent 6612ca8256
commit 087c08f95a
@@ -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 ->