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 <percy@tailscale.com>
pull/393/head
Percy Wegmann 6 months ago committed by GitHub
parent 5476288100
commit 46cdbb7b9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -39,9 +39,9 @@ open class IPNService : VpnService(), libtailscale.IPNService {
} }
"android.net.VpnService" -> { "android.net.VpnService" -> {
// This means we were started by Android due to Always On VPN. // This means we were started by Android due to Always On VPN.
// Get the application to make sure it's been initialized, then // We don't show a foreground notification because we weren't
// request the VPN. // started as a foreground service.
App.get() App.get().setWantRunning(true)
Libtailscale.requestVPN(this) Libtailscale.requestVPN(this)
START_STICKY START_STICKY
} }

Loading…
Cancel
Save