diff options
Diffstat (limited to 'android/src')
| -rw-r--r-- | android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/KeyStatusListener.kt | 11 |
1 files changed, 11 insertions, 0 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 6fa73cf7b8..1dd1515820 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 @@ -3,6 +3,7 @@ package net.mullvad.mullvadvpn.service.endpoint import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch +import net.mullvad.mullvadvpn.ipc.Request import net.mullvad.mullvadvpn.model.KeygenEvent import net.mullvad.talpid.util.EventNotifier @@ -23,6 +24,16 @@ class KeyStatusListener(endpoint: ServiceEndpoint) { onKeygenEvent = { event -> keyStatus = event } } } + + endpoint.dispatcher.apply { + registerHandler(Request.WireGuardGenerateKey::class) { _ -> + generateKey() + } + + registerHandler(Request.WireGuardVerifyKey::class) { _ -> + verifyKey() + } + } } fun generateKey() = GlobalScope.launch(Dispatchers.Default) { |
