No auto standalone VPN

This commit is contained in:
M66B 2023-09-05 16:29:56 +02:00
parent a379a70a51
commit 23a53c151c
1 changed files with 3 additions and 5 deletions

View File

@ -333,9 +333,7 @@ public class ConnectionHelper {
return null;
}
if (standalone_vpn ||
caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)) {
// Standalone VPN: internet not checked
if (caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)) {
// NET_CAPABILITY_NOT_METERED is unreliable on older Android versions
boolean metered = cm.isActiveNetworkMetered();
Log.i("isMetered: active not VPN metered=" + metered);
@ -345,8 +343,8 @@ public class ConnectionHelper {
// Active network is a VPN
Network[] networks = cm.getAllNetworks();
if (networks != null && networks.length == 1) {
// Standalone VPN
if (standalone_vpn && networks != null && networks.length == 1) {
// Internet not checked/validated
boolean metered = cm.isActiveNetworkMetered();
Log.i("isMetered: active VPN metered=" + metered);
return metered;