Add settings to disable DoH

Close #3130
This commit is contained in:
topjohnwu
2020-09-13 04:34:00 -07:00
parent 8a338de696
commit 765b51285a
5 changed files with 53 additions and 32 deletions
@@ -174,6 +174,15 @@ object UpdateChecker : BaseSettingsItem.Toggle() {
}
}
object DoHToggle : BaseSettingsItem.Toggle() {
override val title = R.string.settings_doh_title.asTransitive()
override val description = R.string.settings_doh_description.asTransitive()
override var value = Config.doh
set(value) = setV(value, field, { field = it }) {
Config.doh = it
}
}
// check whether is module already installed beforehand?
object SystemlessHosts : BaseSettingsItem.Blank() {
override val title = R.string.settings_hosts_title.asTransitive()
@@ -58,7 +58,7 @@ class SettingsViewModel(
// Manager
list.addAll(listOf(
Manager,
UpdateChannel, UpdateChannelUrl, UpdateChecker, DownloadPath
UpdateChannel, UpdateChannelUrl, DoHToggle, UpdateChecker, DownloadPath
))
if (Info.env.isActive) {
list.add(ClearRepoCache)