mirror of
https://github.com/wgtunnel/android.git
synced 2026-07-03 14:07:49 +02:00
fix: start foreground
Fixes issue where auto tunnel should be starting service foreground
This commit is contained in:
+1
-1
@@ -26,7 +26,7 @@ class NotificationActionReceiver : BroadcastReceiver() {
|
||||
if (settings.defaultTunnel != null) {
|
||||
ServiceManager.stopVpnService(context)
|
||||
delay(Constants.TOGGLE_TUNNEL_DELAY)
|
||||
ServiceManager.startVpnService(context, settings.defaultTunnel.toString())
|
||||
ServiceManager.startVpnServiceForeground(context, settings.defaultTunnel.toString())
|
||||
}
|
||||
} finally {
|
||||
cancel()
|
||||
|
||||
+3
-3
@@ -311,7 +311,7 @@ class WireGuardConnectivityWatcherService : ForegroundService() {
|
||||
((it.isEthernetConnected &&
|
||||
it.settings.isTunnelOnEthernetEnabled &&
|
||||
!it.isVpnConnected)) -> {
|
||||
ServiceManager.startVpnService(this, it.settings.defaultTunnel!!)
|
||||
ServiceManager.startVpnServiceForeground(this, it.settings.defaultTunnel!!)
|
||||
Timber.i("Condition 1 met")
|
||||
}
|
||||
(!it.isEthernetConnected &&
|
||||
@@ -319,7 +319,7 @@ class WireGuardConnectivityWatcherService : ForegroundService() {
|
||||
!it.isWifiConnected &&
|
||||
it.isMobileDataConnected &&
|
||||
!it.isVpnConnected) -> {
|
||||
ServiceManager.startVpnService(this, it.settings.defaultTunnel!!)
|
||||
ServiceManager.startVpnServiceForeground(this, it.settings.defaultTunnel!!)
|
||||
Timber.i("Condition 2 met")
|
||||
}
|
||||
(!it.isEthernetConnected &&
|
||||
@@ -334,7 +334,7 @@ class WireGuardConnectivityWatcherService : ForegroundService() {
|
||||
!it.settings.trustedNetworkSSIDs.contains(it.currentNetworkSSID) &&
|
||||
it.settings.isTunnelOnWifiEnabled &&
|
||||
(!it.isVpnConnected)) -> {
|
||||
ServiceManager.startVpnService(this, it.settings.defaultTunnel!!)
|
||||
ServiceManager.startVpnServiceForeground(this, it.settings.defaultTunnel!!)
|
||||
Timber.i("Condition 4 met")
|
||||
}
|
||||
(!it.isEthernetConnected &&
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ class ShortcutsActivity : ComponentActivity() {
|
||||
Action.STOP.name -> ServiceManager.stopVpnService(
|
||||
this@ShortcutsActivity
|
||||
)
|
||||
Action.START.name -> ServiceManager.startVpnService(
|
||||
Action.START.name -> ServiceManager.startVpnServiceForeground(
|
||||
this@ShortcutsActivity,
|
||||
tunnelConfig.toString()
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user