mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
fix: wifi name surrounding quotes, prevent multiple auto-tunnel jobs
#768 #797
This commit is contained in:
+5
@@ -73,6 +73,8 @@ class AutoTunnelService : LifecycleService() {
|
||||
|
||||
private val binder = LocalBinder(this)
|
||||
|
||||
private var isServiceRunning = false
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
launchWatcherNotification()
|
||||
@@ -91,6 +93,8 @@ class AutoTunnelService : LifecycleService() {
|
||||
}
|
||||
|
||||
fun start() {
|
||||
if (isServiceRunning) return
|
||||
isServiceRunning = true
|
||||
kotlin
|
||||
.runCatching {
|
||||
launchWatcherNotification()
|
||||
@@ -103,6 +107,7 @@ class AutoTunnelService : LifecycleService() {
|
||||
}
|
||||
|
||||
fun stop() {
|
||||
isServiceRunning = false
|
||||
wakeLock?.let { if (it.isHeld) it.release() }
|
||||
stopSelf()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user