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