Workaround incorrect suspended state

This commit is contained in:
M66B
2020-08-31 09:37:41 +02:00
parent 471f07f18f
commit bc1b9e62c4

View File

@@ -208,7 +208,8 @@ public class ConnectionHelper {
// onLost [... state: DISCONNECTED/DISCONNECTED ... available: true]
NetworkInfo ani = cm.getNetworkInfo(active);
if (ani == null || !ani.isConnected()) {
if (ani == null || ani.getState() == NetworkInfo.State.DISCONNECTED) {
// State can incorrectly be SUSPENDED
Log.i("isMetered: no active info ani=" + ani);
return null;
}