Skip to content

Commit 25e7681

Browse files
authored
android: set VPN status in service APIs (#522)
This is mainly a no-op; right now we are setting the VPN status when we successfully edit prefs with wantRunning=false, but the VPN status is separate from tailscaled status and reflects the status of the VPN interface. This change moves that status update into the Android Service APIs. Updates tailscale/tailscale#12850 Updates tailscale/tailscale#12489 Signed-off-by: kari-ts <[email protected]>
1 parent f8f2ee0 commit 25e7681

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

android/src/main/java/com/tailscale/ipn/IPNService.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,21 @@ open class IPNService : VpnService(), libtailscale.IPNService {
7171
}
7272

7373
override fun close() {
74-
app.setWantRunning(false) { updateVpnStatus(false) }
74+
app.setWantRunning(false) {}
7575
Notifier.setState(Ipn.State.Stopping)
7676
stopForeground(STOP_FOREGROUND_REMOVE)
7777
Libtailscale.serviceDisconnect(this)
7878
}
7979

8080
override fun onDestroy() {
8181
close()
82+
updateVpnStatus(false)
8283
super.onDestroy()
8384
}
8485

8586
override fun onRevoke() {
8687
close()
88+
updateVpnStatus(false)
8789
super.onRevoke()
8890
}
8991

0 commit comments

Comments
 (0)