Sometimes it is just simple

pull/146/head
M66B 7 years ago
parent ea895040f5
commit 542376d0be

@ -310,6 +310,11 @@ public class Helper {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.M) if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.M)
return cm.isActiveNetworkMetered(); return cm.isActiveNetworkMetered();
if (!cm.isActiveNetworkMetered()) {
Log.i(Helper.TAG, "isMetered: active network is unmetered");
return false;
}
Network active = cm.getActiveNetwork(); Network active = cm.getActiveNetwork();
if (active == null) { if (active == null) {
Log.i(Helper.TAG, "isMetered: no active network"); Log.i(Helper.TAG, "isMetered: no active network");
@ -372,6 +377,8 @@ public class Helper {
} }
if (caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)) { if (caps.hasCapability(NetworkCapabilities.NET_CAPABILITY_NOT_VPN)) {
Log.i(Helper.TAG, "isMetered: underlying caps=" + caps);
if (ni.isConnected()) { if (ni.isConnected()) {
connected = true; connected = true;
Log.i(Helper.TAG, "isMetered: underlying is connected"); Log.i(Helper.TAG, "isMetered: underlying is connected");

Loading…
Cancel
Save