diff options
author | cyBerta <cyberta@riseup.net> | 2021-11-08 00:54:24 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2021-11-08 00:54:24 +0100 |
commit | 0b80fad26c91e5aa0faf8bc0132184eeeb7883b0 (patch) | |
tree | 7e11500369176c54a122f11e857840f9c65cc379 /app/src/main/java/de | |
parent | 62c28b219a85aa3074356e1e49e92e30c1166c3b (diff) |
revert restriction to be connected to wifi in order to use snowflake/tor fallback
Diffstat (limited to 'app/src/main/java/de')
-rw-r--r-- | app/src/main/java/de/blinkt/openvpn/core/NetworkUtils.java | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/NetworkUtils.java b/app/src/main/java/de/blinkt/openvpn/core/NetworkUtils.java index cbb58f0f..a4f09806 100644 --- a/app/src/main/java/de/blinkt/openvpn/core/NetworkUtils.java +++ b/app/src/main/java/de/blinkt/openvpn/core/NetworkUtils.java @@ -80,30 +80,4 @@ public class NetworkUtils { } return nets; } - - public static boolean isConnectedToWifi(Context context) { - ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); - if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) { - NetworkInfo wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); - Log.d(TAG, "isConnectedToWifi (<=LOLLIPOP_MR1): " + wifi.isConnected()); - return wifi.isConnected(); - } else if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.O_MR1) { - NetworkInfo[] netInfos = connManager.getAllNetworkInfo(); - for (NetworkInfo netInfo : netInfos) { - if (netInfo != null && netInfo.getType() == ConnectivityManager.TYPE_WIFI) { - Log.d(TAG, "isConnectedToWifi (<= Build.VERSION_CODES.O_MR1): " + netInfo.isConnected()); - return netInfo.isConnected(); - } - } - } else { - NetworkInfo netInfo = connManager.getActiveNetworkInfo(); - if(netInfo != null) { - NetworkCapabilities networkCapabilities = connManager.getNetworkCapabilities(connManager.getActiveNetwork()); - Log.d(TAG, "isConnectedToWifi (> Build.VERSION_CODES.O_MR1): " + networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI)); - return networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_WIFI); - } - } - - return false; - } }
\ No newline at end of file |