summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-06-04 09:18:32 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-06-04 09:18:32 +0200
commit937d8cc2f15efe6a6efc4aef6133dc030b9823e1 (patch)
tree85328fe524b559ecd1203d5aad9221fed7c13d09 /android
parent4b1028f034ea71e35cdb410c168a8bb82b086eed (diff)
downloadmullvadvpn-937d8cc2f15efe6a6efc4aef6133dc030b9823e1.tar.xz
mullvadvpn-937d8cc2f15efe6a6efc4aef6133dc030b9823e1.zip
Fix connectivity manager util tests
Diffstat (limited to 'android')
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/talpid/util/ConnectivityManagerUtilKtTest.kt5
-rw-r--r--android/lib/talpid/src/main/kotlin/net/mullvad/talpid/util/ConnectivityManagerUtil.kt4
2 files changed, 5 insertions, 4 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/talpid/util/ConnectivityManagerUtilKtTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/talpid/util/ConnectivityManagerUtilKtTest.kt
index a3d684611d..5653e43712 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/talpid/util/ConnectivityManagerUtilKtTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/talpid/util/ConnectivityManagerUtilKtTest.kt
@@ -24,9 +24,9 @@ import net.mullvad.talpid.model.Connectivity
import net.mullvad.talpid.model.IpAvailability
import net.mullvad.talpid.util.NetworkEvent
import net.mullvad.talpid.util.UnderlyingConnectivityStatusResolver
-import net.mullvad.talpid.util.allNetworkEvents
import net.mullvad.talpid.util.defaultNetworkEvents
import net.mullvad.talpid.util.hasInternetConnectivity
+import net.mullvad.talpid.util.nonVpnInternetNetworksEvents
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
@@ -36,7 +36,8 @@ class ConnectivityManagerUtilKtTest {
@BeforeEach
fun setup() {
mockkStatic(CONNECTIVITY_MANAGER_UTIL_CLASS)
- every { connectivityManager.allNetworkEvents() } returns flowOf(NetworkEvent.Unavailable)
+ every { connectivityManager.nonVpnInternetNetworksEvents() } returns
+ flowOf(NetworkEvent.Unavailable)
}
/** User being online, the listener should emit once with `true` */
diff --git a/android/lib/talpid/src/main/kotlin/net/mullvad/talpid/util/ConnectivityManagerUtil.kt b/android/lib/talpid/src/main/kotlin/net/mullvad/talpid/util/ConnectivityManagerUtil.kt
index 1d1b82e685..923aca44fb 100644
--- a/android/lib/talpid/src/main/kotlin/net/mullvad/talpid/util/ConnectivityManagerUtil.kt
+++ b/android/lib/talpid/src/main/kotlin/net/mullvad/talpid/util/ConnectivityManagerUtil.kt
@@ -199,9 +199,9 @@ internal fun ConnectivityManager.activeRawNetworkState(): RawNetworkState? =
* default network and depending on if it is a VPN. If it is not a VPN we check the network
* properties directly and if it is a VPN we use a socket to check the underlying network. A
* debounce is applied to avoid emitting too many events and to avoid setting the app in an offline
- * state when switching networks. The flow is combined with the all network events to fix issues
+ * state when switching networks. The flow is combined with the non-VPN network events to fix issues
* with the default network not being updated correctly on Android 9 and below when the VPN is
- * turned on. The all network event is not used it is just there to trigger a new connectivity
+ * turned on. The non-VPN network event is not used it is just there to trigger a new connectivity
* check.
*/
@OptIn(FlowPreview::class)