From a843c93669fc4a9e847d5dc84f564993af1913a5 Mon Sep 17 00:00:00 2001 From: Andrea Gottardo Date: Fri, 16 Aug 2024 15:14:42 -0700 Subject: [PATCH] Revert "VPNServiceBuilder: document excludeRoute not supported on pre-33 API" (#471) --- .../java/com/tailscale/ipn/VPNServiceBuilder.kt | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/android/src/main/java/com/tailscale/ipn/VPNServiceBuilder.kt b/android/src/main/java/com/tailscale/ipn/VPNServiceBuilder.kt index 4a8b5a8..eebbe10 100644 --- a/android/src/main/java/com/tailscale/ipn/VPNServiceBuilder.kt +++ b/android/src/main/java/com/tailscale/ipn/VPNServiceBuilder.kt @@ -4,15 +4,11 @@ package com.tailscale.ipn import android.net.VpnService -import android.os.Build -import android.util.Log import libtailscale.ParcelFileDescriptor import java.net.InetAddress import android.net.IpPrefix as AndroidIpPrefix class VPNServiceBuilder(private val builder: VpnService.Builder) : libtailscale.VPNServiceBuilder { - private val TAG = "VPNServiceBuilder" - override fun addAddress(p0: String, p1: Int) { builder.addAddress(p0, p1) } @@ -26,14 +22,9 @@ class VPNServiceBuilder(private val builder: VpnService.Builder) : libtailscale. } override fun excludeRoute(p0: String, p1: Int) { - // excludeRoute requires API 33 (Android 13) - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - val inetAddress = InetAddress.getByName(p0) - val prefix = AndroidIpPrefix(inetAddress, p1) - builder.excludeRoute(prefix) - } else { - Log.d(TAG, "excludeRoute is not supported on Android API < 33, 'Allow LAN Access' will be ignored") - } + val inetAddress = InetAddress.getByName(p0) + val prefix = AndroidIpPrefix(inetAddress, p1) + builder.excludeRoute(prefix) } override fun addSearchDomain(p0: String) {