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:
parent
e7dd1a01b1
commit
56cc9043de
1 changed files with 8 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue