Fix debug channel preference not persisting

This commit is contained in:
topjohnwu 2022-05-16 20:16:50 -07:00
parent d3fe3a711a
commit 0772f6dcaf

View File

@ -172,10 +172,11 @@ object Config : PreferenceModel, DBConfig {
suBiometric = true suBiometric = true
remove(SU_FINGERPRINT) remove(SU_FINGERPRINT)
prefs.getString(Key.UPDATE_CHANNEL, null).also { prefs.getString(Key.UPDATE_CHANNEL, null).also {
if (it == null) if (it == null ||
it.toInt() > Value.DEBUG_CHANNEL ||
it.toInt() < Value.DEFAULT_CHANNEL) {
putString(Key.UPDATE_CHANNEL, defaultChannel.toString()) putString(Key.UPDATE_CHANNEL, defaultChannel.toString())
else if (it.toInt() > Value.CANARY_CHANNEL) }
putString(Key.UPDATE_CHANNEL, Value.CANARY_CHANNEL.toString())
} }
} }
} }