Commit 821c6eb9 authored by Daniel Wolf's avatar Daniel Wolf
Browse files

Do not run vpn watchdog when in non-VPN mode

parent a5ae877e
......@@ -1444,9 +1444,15 @@ class DnsVpnService : VpnService(), Runnable, CoroutineScope {
hideBadConnectionNotification()
}, logger = this@DnsVpnService.logger, advancedLogging = getPreferences().advancedLogging)
}
vpnWatchdog = VpnWatchDog({
showVpnRevokedNotification()
}, this)
vpnWatchdog = if (!runInNonVpnMode) {
vpnWatchdog?.stop()
VpnWatchDog({
showVpnRevokedNotification()
}, this)
} else {
vpnWatchdog?.stop()
null
}
}
private fun createQueryLogger(): QueryListener? {
......
......@@ -26,7 +26,7 @@ import kotlinx.coroutines.*
* You can contact the developer at daniel.wolf@frostnerd.com.
*/
class VpnWatchDog(private val onVpnDisconnected:() -> Unit,
private val context: Context) {
context: Context) {
private val supervisor = SupervisorJob()
private val scope = CoroutineScope(supervisor + Dispatchers.IO)
private var running = true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment