Commit b63c9bfd authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Add a setting to disable the automatic speed test to determine latency bounds

Implements https://github.com/Ch4t4r/Nebulo/issues/7
parent 88f01cda
...@@ -379,6 +379,8 @@ class MainFragment : Fragment() { ...@@ -379,6 +379,8 @@ class MainFragment : Fragment() {
// But if a "good" server has a bad connection, chances are the smaller ones do as well // But if a "good" server has a bad connection, chances are the smaller ones do as well
// And in that case the smaller server should be measured on the bigger ones to have a point of reference // And in that case the smaller server should be measured on the bigger ones to have a point of reference
// as the values I chose are between average to best-case, not worst-case. // as the values I chose are between average to best-case, not worst-case.
if(!context.getPreferences().compareDnsSpeedsAtLaunch) return
launchWithLifecycle { launchWithLifecycle {
val httpsEngine = createHttpCronetEngineIfInstalled(context) val httpsEngine = createHttpCronetEngineIfInstalled(context)
val fastServerAverage = (AbstractHttpsDNSHandle.suspendUntilKnownServersArePopulated( val fastServerAverage = (AbstractHttpsDNSHandle.suspendUntilKnownServersArePopulated(
......
...@@ -239,6 +239,7 @@ class AppSettingsSharedPreferences(context: Context) : AppSettings, SimpleTypedP ...@@ -239,6 +239,7 @@ class AppSettingsSharedPreferences(context: Context) : AppSettings, SimpleTypedP
var restartVpnOnNetworkChange:Boolean by booleanPref("restart_vpn_networkchange", false) var restartVpnOnNetworkChange:Boolean by booleanPref("restart_vpn_networkchange", false)
override var bypassSearchdomains: Boolean by booleanPref("bypass_searchdomains", true) override var bypassSearchdomains: Boolean by booleanPref("bypass_searchdomains", true)
override var pauseOnCaptivePortal: Boolean by booleanPref("pause_on_captive_portal", true) override var pauseOnCaptivePortal: Boolean by booleanPref("pause_on_captive_portal", true)
var compareDnsSpeedsAtLaunch: Boolean by booleanPref("compare_dns_speeds", true)
var mapQueryRefusedToHostBlock:Boolean by booleanPref("map_query_refused", true) var mapQueryRefusedToHostBlock:Boolean by booleanPref("map_query_refused", true)
override var queryLoggingEnabled: Boolean by booleanPref("log_dns_queries", false) override var queryLoggingEnabled: Boolean by booleanPref("log_dns_queries", false)
......
...@@ -148,6 +148,8 @@ ...@@ -148,6 +148,8 @@
<string name="title_pause_on_captiveportal">Pause on captive portal</string> <string name="title_pause_on_captiveportal">Pause on captive portal</string>
<string name="summary_pause_on_captiveportal">Don\'t use DoH if a captive portal is detected. It will automatically be resumed shortly after logging in.\nDisabling it might prevent you from opening the captive portal site to log in</string> <string name="summary_pause_on_captiveportal">Don\'t use DoH if a captive portal is detected. It will automatically be resumed shortly after logging in.\nDisabling it might prevent you from opening the captive portal site to log in</string>
<string name="title_test_speed_comparison">Server speed comparison</string>
<string name="summary_test_speed_comparison">When on the main screen, determine the latency to popular servers to better indicate the latency of the current active server</string>
<string name="preference_category_querylogging">Query logging</string> <string name="preference_category_querylogging">Query logging</string>
......
...@@ -37,5 +37,11 @@ ...@@ -37,5 +37,11 @@
android:key="pause_on_captive_portal" android:key="pause_on_captive_portal"
android:summary="@string/summary_pause_on_captiveportal" android:summary="@string/summary_pause_on_captiveportal"
android:title="@string/title_pause_on_captiveportal" /> android:title="@string/title_pause_on_captiveportal" />
<CheckBoxPreference
android:defaultValue="true"
android:key="compare_dns_speeds"
android:summary="@string/summary_test_speed_comparison"
android:title="@string/title_test_speed_comparison"/>
</androidx.preference.PreferenceCategory> </androidx.preference.PreferenceCategory>
</androidx.preference.PreferenceScreen> </androidx.preference.PreferenceScreen>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment