Changed network workaround

pull/176/head
M66B 5 years ago
parent a7124bfb93
commit f04e4f8ef9

@ -177,7 +177,7 @@ public class ConnectionHelper {
if (cm == null) if (cm == null)
return null; return null;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
NetworkInfo ani = cm.getActiveNetworkInfo(); NetworkInfo ani = cm.getActiveNetworkInfo();
if (ani == null || !ani.isConnected()) if (ani == null || !ani.isConnected())
return null; return null;
@ -264,11 +264,6 @@ public class ConnectionHelper {
Log.i("isMetered: underlying is unmetered"); Log.i("isMetered: underlying is unmetered");
return false; return false;
} }
} else {
// Workaround: active network = VPN, active network info = WiFi
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M &&
network.equals(active) && !cm.isActiveNetworkMetered())
return false;
} }
} }

Loading…
Cancel
Save