From 03a9e4c34ee5f94b156ffd8a0134d738a44d76f1 Mon Sep 17 00:00:00 2001 From: Zane Schepke Date: Thu, 23 Jan 2025 19:44:25 -0500 Subject: [PATCH] fix: update state on state machine stop --- .../core/src/main/java/net/nymtech/vpn/backend/NymBackend.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nym-vpn-android/core/src/main/java/net/nymtech/vpn/backend/NymBackend.kt b/nym-vpn-android/core/src/main/java/net/nymtech/vpn/backend/NymBackend.kt index fa1fdc2982..f3cfc9b1a2 100644 --- a/nym-vpn-android/core/src/main/java/net/nymtech/vpn/backend/NymBackend.kt +++ b/nym-vpn-android/core/src/main/java/net/nymtech/vpn/backend/NymBackend.kt @@ -191,6 +191,8 @@ class NymBackend private constructor(val context: Context) : Backend, TunnelStat } catch (e: VpnException) { runCatching { forgetAccount() + }.onFailure { + Timber.e(e) } throw e } @@ -297,6 +299,7 @@ class NymBackend private constructor(val context: Context) : Backend, TunnelStat }.onFailure { Timber.e(it) } + onStateChange(Tunnel.State.Down) } } @@ -353,7 +356,7 @@ class NymBackend private constructor(val context: Context) : Backend, TunnelStat private fun startNetworkStatusMonitor() = lifecycleScope.launch { NetworkConnectivityService(this@StateMachineService).networkStatus.collect { Timber.d("New network event: $it") - owner?.onNetworkStatusChange(it) ?: Timber.w("OWNER IS NULL!!") + owner?.onNetworkStatusChange(it) } }