Workaround Android connectivity bug

This commit is contained in:
M66B 2019-09-19 10:16:46 +02:00
parent 306d6539cc
commit 23c3ab2010
1 changed files with 5 additions and 0 deletions

View File

@ -165,6 +165,11 @@ public class ConnectionHelper {
return null;
}
// onLost [... state: DISCONNECTED/DISCONNECTED ... available: true]
NetworkInfo ani = cm.getNetworkInfo(active);
if (ani == null || !ani.isConnected())
return null;
NetworkCapabilities caps = cm.getNetworkCapabilities(active);
if (caps == null) {
Log.i("isMetered: active no caps");