From 7abd72c7e7e00581703792e9da4087e823bd81f5 Mon Sep 17 00:00:00 2001 From: Norbel AMBANUMBEN Date: Wed, 11 Dec 2024 20:24:36 +0100 Subject: [PATCH] fix: change default for `ndt` and `dash` in autorun --- .../ooniprobe/common/PreferenceManagerExtension.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/openobservatory/ooniprobe/common/PreferenceManagerExtension.kt b/app/src/main/java/org/openobservatory/ooniprobe/common/PreferenceManagerExtension.kt index 21e547707..03e545a56 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/common/PreferenceManagerExtension.kt +++ b/app/src/main/java/org/openobservatory/ooniprobe/common/PreferenceManagerExtension.kt @@ -31,7 +31,7 @@ fun PreferenceManager.resolveStatus( sp.getBoolean( getPreferenceKey(name = name, prefix = prefix, autoRun = true), when(prefix.isEmpty()) { - true -> true + true -> autorunDefault(name = name) false -> false } ) @@ -185,3 +185,11 @@ private fun PreferenceManager.setValue(name: String, value: Boolean): Boolean { commit() } } + +fun autorunDefault(name: String): Boolean { + return when (name) { + Ndt.NAME, + Dash.NAME -> false + else -> true + } +} \ No newline at end of file