Skip to content

Commit

Permalink
android: hide allow LAN access if feature not enabled
Browse files Browse the repository at this point in the history
excludeRoute is only supported on API 33+, so we are not supporting allow LAN access for older versions. To avoid confusion, don't show the option if the feature is not enabled.

Updates tailscale/corp#25083

Signed-off-by: kari-ts <[email protected]>
  • Loading branch information
kari-ts committed Dec 5, 2024
1 parent 205aeae commit 9db0d29
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ import com.tailscale.ipn.ui.viewModel.ExitNodePickerViewModel
import com.tailscale.ipn.ui.viewModel.ExitNodePickerViewModelFactory
import com.tailscale.ipn.ui.viewModel.selected
import kotlinx.coroutines.flow.MutableStateFlow
import android.os.Build

@Composable
fun ExitNodePicker(
nav: ExitNodePickerNav,
model: ExitNodePickerViewModel = viewModel(factory = ExitNodePickerViewModelFactory(nav))
) {
LoadingIndicator.Wrap {
LoadingIndicator.Wrap {
Scaffold(topBar = { Header(R.string.choose_exit_node, onBack = nav.onNavigateBackHome) }) {
innerPadding ->
val tailnetExitNodes by model.tailnetExitNodes.collectAsState()
Expand Down Expand Up @@ -99,7 +100,8 @@ fun ExitNodePicker(
}
}

if (!allowLanAccessMDMDisposition.value.hiddenFromUser) {
// https://developer.android.com/reference/android/net/VpnService.Builder#excludeRoute(android.net.IpPrefix) - excludeRoute is only supported in API 33+, so don't show the option if allow LAN access is not enabled.
if (!allowLanAccessMDMDisposition.value.hiddenFromUser && Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
item(key = "allowLANAccess") {
Lists.SectionDivider()

Expand Down

0 comments on commit 9db0d29

Please sign in to comment.