aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/github/daneren2005/dsub/util/Util.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java
index 02cb8eb9..27bfa365 100644
--- a/src/github/daneren2005/dsub/util/Util.java
+++ b/src/github/daneren2005/dsub/util/Util.java
@@ -873,15 +873,22 @@ public final class Util {
return Util.getScaledHeight((double) bitmap.getHeight(), (double) bitmap.getWidth(), width);
}
- public static boolean isNetworkConnected(Context context) {
+ public static boolean isNetworkConnected(Context context) {
+ return isNetworkConnected(context, false);
+ }
+ public static boolean isNetworkConnected(Context context, boolean streaming) {
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = manager.getActiveNetworkInfo();
boolean connected = networkInfo != null && networkInfo.isConnected();
- boolean wifiConnected = connected && networkInfo.getType() == ConnectivityManager.TYPE_WIFI;
- boolean wifiRequired = isWifiRequiredForDownload(context);
+ if(streaming) {
+ boolean wifiConnected = connected && networkInfo.getType() == ConnectivityManager.TYPE_WIFI;
+ boolean wifiRequired = isWifiRequiredForDownload(context);
- return connected && (!wifiRequired || wifiConnected);
+ return connected && (!wifiRequired || wifiConnected);
+ } else {
+ return connected;
+ }
}
public static boolean isWifiConnected(Context context) {
ConnectivityManager manager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);