From 1a115c623f18ac2ca7f1bd2813a8d0a2bde58793 Mon Sep 17 00:00:00 2001 From: Jonathan Nobels Date: Tue, 18 Jun 2024 09:43:15 -0400 Subject: [PATCH] android/ui: open login screen on toggle updates tailscale/corp#20930 To address review concerns regarding the toggle being unresponsive with the d-pad. We'll now open the QR login screen on android TV if you toggle the VPN when we're in the NeedsLogin state. Signed-off-by: Jonathan Nobels --- .../main/java/com/tailscale/ipn/ui/viewModel/MainViewModel.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/src/main/java/com/tailscale/ipn/ui/viewModel/MainViewModel.kt b/android/src/main/java/com/tailscale/ipn/ui/viewModel/MainViewModel.kt index f6d36eb9e5..bf1dad5af9 100644 --- a/android/src/main/java/com/tailscale/ipn/ui/viewModel/MainViewModel.kt +++ b/android/src/main/java/com/tailscale/ipn/ui/viewModel/MainViewModel.kt @@ -13,6 +13,7 @@ import com.tailscale.ipn.mdm.MDMSettings import com.tailscale.ipn.ui.model.Ipn import com.tailscale.ipn.ui.model.Ipn.State import com.tailscale.ipn.ui.notifier.Notifier +import com.tailscale.ipn.ui.util.AndroidTVUtil.isAndroidTV import com.tailscale.ipn.ui.util.PeerCategorizer import com.tailscale.ipn.ui.util.PeerSet import com.tailscale.ipn.ui.util.TimeUtil @@ -112,6 +113,7 @@ class MainViewModel : IpnViewModel() { when { !isPrepared -> showVPNPermissionLauncherIfUnauthorized() state == Ipn.State.Running -> stopVPN() + state == Ipn.State.NeedsLogin && isAndroidTV() -> login() else -> startVPN() } }