From 46cdbb7b9b22c75be85f0d66d158cbf882fcc018 Mon Sep 17 00:00:00 2001 From: Percy Wegmann Date: Mon, 13 May 2024 17:27:53 -0500 Subject: [PATCH] android: set wantRunning to true when started from Always On VPN (#392) This way, even if the VPN wasn't previously manually enabled, it'll still turn on after reboot Updates #cleanup Signed-off-by: Percy Wegmann --- android/src/main/java/com/tailscale/ipn/IPNService.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/src/main/java/com/tailscale/ipn/IPNService.kt b/android/src/main/java/com/tailscale/ipn/IPNService.kt index f64a2e2..73508a8 100644 --- a/android/src/main/java/com/tailscale/ipn/IPNService.kt +++ b/android/src/main/java/com/tailscale/ipn/IPNService.kt @@ -39,9 +39,9 @@ open class IPNService : VpnService(), libtailscale.IPNService { } "android.net.VpnService" -> { // This means we were started by Android due to Always On VPN. - // Get the application to make sure it's been initialized, then - // request the VPN. - App.get() + // We don't show a foreground notification because we weren't + // started as a foreground service. + App.get().setWantRunning(true) Libtailscale.requestVPN(this) START_STICKY }