1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-19 05:38:31 +00:00

Check if active network is connected

This commit is contained in:
M66B 2019-02-10 08:05:17 +00:00
parent e7dd1a01b1
commit 56cc9043de

View file

@ -706,8 +706,15 @@ public class Helper {
return null;
}
NetworkInfo ani = cm.getNetworkInfo(active);
if (log)
EntityLog.log(context, "isMetered: active info=" + cm.getNetworkInfo(active));
EntityLog.log(context, "isMetered: active info=" + ani);
if (ani == null || !ani.isConnected()) {
if (log)
EntityLog.log(context, "isMetered: active network not connected");
return null;
}
NetworkCapabilities caps = cm.getNetworkCapabilities(active);
if (caps == null) {