diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2020-12-15 15:02:09 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-03-29 14:22:55 +0000 |
| commit | 0d65862fbe1231cc03e35f94aa7023e39f8daabf (patch) | |
| tree | 73e52351412a5dbab299cc9a3ed54a2f3469607d /android/src | |
| parent | c59138a051216d37f6d038cfbeee7e041ceba2d8 (diff) | |
| download | mullvadvpn-0d65862fbe1231cc03e35f94aa7023e39f8daabf.tar.xz mullvadvpn-0d65862fbe1231cc03e35f94aa7023e39f8daabf.zip | |
Send WireGuard key status through the messenger
Diffstat (limited to 'android/src')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/KeyStatusListener.kt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/KeyStatusListener.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/KeyStatusListener.kt index 1dd1515820..2c506aa6cf 100644 --- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/KeyStatusListener.kt +++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/KeyStatusListener.kt @@ -1,8 +1,10 @@ package net.mullvad.mullvadvpn.service.endpoint +import kotlin.properties.Delegates.observable import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch +import net.mullvad.mullvadvpn.ipc.Event import net.mullvad.mullvadvpn.ipc.Request import net.mullvad.mullvadvpn.model.KeygenEvent import net.mullvad.talpid.util.EventNotifier @@ -12,7 +14,11 @@ class KeyStatusListener(endpoint: ServiceEndpoint) { val onKeyStatusChange = EventNotifier<KeygenEvent?>(null) - var keyStatus by onKeyStatusChange.notifiable() + var keyStatus by observable<KeygenEvent?>(null) { _, _, status -> + endpoint.sendEvent(Event.WireGuardKeyStatus(status)) + onKeyStatusChange.notify(status) + } + private set init { daemon.registerListener(this) { newDaemon -> |
