Check restricted/foreground for non VPN only

pull/214/head
M66B 1 year ago
parent 6df8613004
commit 1a8b713e72

@ -311,17 +311,17 @@ public class ConnectionHelper {
Log.i("isMetered: not validated captive=" + captive); Log.i("isMetered: not validated captive=" + captive);
return null; return null;
} }
}
if (!caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)) { if (!caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_RESTRICTED)) {
Log.i("isMetered: active restricted"); Log.i("isMetered: active restricted");
return null; return null;
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P &&
!caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_FOREGROUND)) { !caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_FOREGROUND)) {
Log.i("isMetered: active background"); Log.i("isMetered: active background");
return null; return null;
}
} }
if (vpn_only) { if (vpn_only) {

Loading…
Cancel
Save