1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2025-01-03 13:54:09 +00:00

Simplification

This commit is contained in:
M66B 2020-06-07 12:44:23 +02:00
parent 3c14c2659e
commit 52dfc830c0

View file

@ -160,7 +160,7 @@ public class Util {
public static boolean isNetworkActive(Context context) { public static boolean isNetworkActive(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
return (cm == null ? false : cm.getActiveNetworkInfo() != null); return (cm != null && cm.getActiveNetworkInfo() != null);
} }
public static boolean isConnected(Context context) { public static boolean isConnected(Context context) {