From 4b75381adb8ce332ffee50c4e1291010ec4f083c Mon Sep 17 00:00:00 2001 From: Zane Schepke Date: Sat, 1 Jul 2023 01:09:35 -0400 Subject: [PATCH] fix: watcher service mobile data monitoring Fix for a bug where watcher service does not start monitoring mobile data when feature is turned on --- app/build.gradle.kts | 2 +- .../service/foreground/WireGuardConnectivityWatcherService.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ea406390..135e813e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -17,7 +17,7 @@ android { val versionMajor = 1 val versionMinor = 1 - val versionPatch = 4 + val versionPatch = 5 val versionBuild = 0 defaultConfig { diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardConnectivityWatcherService.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardConnectivityWatcherService.kt index 9cd5f6b4..dcf6497d 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardConnectivityWatcherService.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/foreground/WireGuardConnectivityWatcherService.kt @@ -131,7 +131,9 @@ class WireGuardConnectivityWatcherService : ForegroundService() { if(!settings.isNullOrEmpty()) { setting = settings[0] } - watchForWifiConnectivityChanges() + GlobalScope.launch { + watchForWifiConnectivityChanges() + } if(setting.isTunnelOnMobileDataEnabled) { GlobalScope.launch { watchForMobileDataConnectivityChanges()