Revert "Simplification"

This reverts commit 2861b11661.
This commit is contained in:
M66B 2023-12-03 17:53:59 +01:00
parent b3dd446dd3
commit d786249594
1 changed files with 10 additions and 1 deletions

View File

@ -38,7 +38,6 @@ import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.LinkProperties;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
@ -166,6 +165,16 @@ public class Util {
if (ni != null && ni.isConnected())
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;
}