summaryrefslogtreecommitdiffhomepage
path: root/android/src
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-04-20 20:17:22 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-04-22 20:18:36 +0000
commitab67bac8bced245de652dfaabfe825cc1090d564 (patch)
tree6707bb55ed1daddb7876692a91f00880f61eed22 /android/src
parent996afe13a84cc263ec54889beb41feb9fa26baf1 (diff)
downloadmullvadvpn-ab67bac8bced245de652dfaabfe825cc1090d564.tar.xz
mullvadvpn-ab67bac8bced245de652dfaabfe825cc1090d564.zip
Send initial VPN request when UI connects
Diffstat (limited to 'android/src')
-rw-r--r--android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt
index 188f75a0ea..93c7a8a9cf 100644
--- a/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt
+++ b/android/src/main/kotlin/net/mullvad/mullvadvpn/service/endpoint/ServiceEndpoint.kt
@@ -109,7 +109,7 @@ class ServiceEndpoint(
synchronized(this) {
listeners.add(listener)
- val initialEvents = listOf(
+ val initialEvents = mutableListOf(
Event.TunnelStateChange(connectionProxy.state),
Event.LoginStatus(accountCache.onLoginStatusChange.latestEvent),
Event.AccountHistory(accountCache.onAccountHistoryChange.latestEvent),
@@ -124,6 +124,10 @@ class ServiceEndpoint(
Event.ListenerReady
)
+ if (vpnPermission.waitingForResponse) {
+ initialEvents.add(Event.VpnPermissionRequest)
+ }
+
initialEvents.forEach { event ->
listener.send(event.message)
}