summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
Diffstat (limited to 'android')
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/serviceconnection/CustomDns.kt11
1 files changed, 11 insertions, 0 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/serviceconnection/CustomDns.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/serviceconnection/CustomDns.kt
index 9d9e235007..f87fea04d2 100644
--- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/serviceconnection/CustomDns.kt
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/ui/serviceconnection/CustomDns.kt
@@ -9,8 +9,17 @@ import net.mullvad.mullvadvpn.util.trySendRequest
import net.mullvad.talpid.util.EventNotifier
class CustomDns(private val connection: Messenger, private val settingsListener: SettingsListener) {
+ @Deprecated(
+ message = "Will soon be removed in favor of onDnsOptionsChanged.",
+ replaceWith = ReplaceWith("onDnsOptionsChanged")
+ )
val onEnabledChanged = EventNotifier(false)
+ @Deprecated(
+ message = "Will soon be removed in favor of onDnsOptionsChanged.",
+ replaceWith = ReplaceWith("onDnsOptionsChanged")
+ )
val onDnsServersChanged = EventNotifier<List<InetAddress>>(emptyList())
+ val onDnsOptionsChanged = EventNotifier<DnsOptions?>(null)
init {
settingsListener.dnsOptionsNotifier.subscribe(this) { maybeDnsOptions ->
@@ -18,6 +27,7 @@ class CustomDns(private val connection: Messenger, private val settingsListener:
synchronized(this) {
onEnabledChanged.notifyIfChanged(dnsOptions.state == DnsState.Custom)
onDnsServersChanged.notifyIfChanged(dnsOptions.customOptions.addresses)
+ onDnsOptionsChanged.notifyIfChanged(dnsOptions)
}
}
}
@@ -66,6 +76,7 @@ class CustomDns(private val connection: Messenger, private val settingsListener:
fun onDestroy() {
onEnabledChanged.unsubscribeAll()
onDnsServersChanged.unsubscribeAll()
+ onDnsOptionsChanged.unsubscribeAll()
settingsListener.dnsOptionsNotifier.unsubscribe(this)
}