mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-22 07:43:15 +00:00
Simplification
This commit is contained in:
parent
2a60b69a3f
commit
2861b11661
1 changed files with 1 additions and 10 deletions
|
@ -38,6 +38,7 @@ import android.graphics.BitmapFactory;
|
||||||
import android.net.ConnectivityManager;
|
import android.net.ConnectivityManager;
|
||||||
import android.net.LinkProperties;
|
import android.net.LinkProperties;
|
||||||
import android.net.Network;
|
import android.net.Network;
|
||||||
|
import android.net.NetworkCapabilities;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import android.net.wifi.WifiManager;
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
@ -165,16 +166,6 @@ public class Util {
|
||||||
if (ni != null && ni.isConnected())
|
if (ni != null && ni.isConnected())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
Network[] networks = cm.getAllNetworks();
|
|
||||||
if (networks == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
for (Network network : networks) {
|
|
||||||
ni = cm.getNetworkInfo(network);
|
|
||||||
if (ni != null && ni.getType() != ConnectivityManager.TYPE_VPN && ni.isConnected())
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue