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>
(cherry picked from commit 46cdbb7b9b)
release-branch/1.66
Percy Wegmann 2 years ago committed by Andrea Gottardo
parent b5300b9f49
commit a386d3e1eb

@ -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
}

Loading…
Cancel
Save