summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/SplitTunneling.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/SplitTunneling.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/SplitTunneling.kt
index a2e574a359..d6455ea9a3 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/SplitTunneling.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/SplitTunneling.kt
@@ -9,9 +9,11 @@ import net.mullvad.talpid.util.EventNotifier
class SplitTunneling(persistence: SplitTunnelingPersistence, endpoint: ServiceEndpoint) {
private val excludedApps = persistence.excludedApps.toMutableSet()
- private var enabled by observable(persistence.enabled) { _, _, isEnabled ->
- persistence.enabled = isEnabled
- update()
+ private var enabled by observable(persistence.enabled) { _, wasEnabled, isEnabled ->
+ if (wasEnabled != isEnabled) {
+ persistence.enabled = isEnabled
+ update()
+ }
}
val onChange = EventNotifier<List<String>?>(excludedApps.toList())