diff --git a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt index 8b67ef462863..d05df426f831 100644 --- a/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt +++ b/android/lib/daemon-grpc/src/main/kotlin/net/mullvad/mullvadvpn/lib/daemon/grpc/ManagementService.kt @@ -194,6 +194,7 @@ class ManagementService( error("ManagementService already started") } + channel.resetConnectBackoff() job = scope.launch { subscribeEvents() } } diff --git a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt index 3a3bb4b87a01..40eb9bc312b3 100644 --- a/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt +++ b/android/service/src/main/kotlin/net/mullvad/mullvadvpn/service/MullvadVpnService.kt @@ -91,12 +91,14 @@ class MullvadVpnService : TalpidVpnService(), ShouldBeOnForegroundProvider { // TODO We should avoid lifecycleScope.launch (current needed due to InetSocketAddress // with intent from API) lifecycleScope.launch(context = Dispatchers.IO) { - managementService.start() - prepareFiles(this@MullvadVpnService) migrateSplitTunneling.migrate() + Logger.d("Start daemon") startDaemon() + + Logger.d("Start management service") + managementService.start() } } @@ -206,9 +208,10 @@ class MullvadVpnService : TalpidVpnService(), ShouldBeOnForegroundProvider { override fun onDestroy() { Logger.i("MullvadVpnService: onDestroy") + // Shutting down the daemon gracefully managementService.stop() - // Shutting down the daemon gracefully + Logger.i("Shutdown MullvadDaemon") MullvadDaemon.shutdown() super.onDestroy() }