Remove the code that requires ACCESS_NETWORK_STATE

This commit is contained in:
Hristo Hristov
2016-10-07 11:31:24 +03:00
parent adad33a129
commit 701c9d26cd

View File

@@ -59,7 +59,6 @@ public class Fetcher extends Resizer {
*/
public Fetcher(Context context) {
super(context);
checkConnection(context);
mHttpCacheDir = Cache.getDiskCacheDir(context, HTTP_CACHE_DIR);
mPackageName = context.getPackageName();
}
@@ -147,20 +146,6 @@ public class Fetcher extends Resizer {
}
}
/**
* Simple network connection check.
*
* @param context
*/
private void checkConnection(Context context) {
final ConnectivityManager cm =
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
final NetworkInfo networkInfo = cm.getActiveNetworkInfo();
if (networkInfo == null || !networkInfo.isConnectedOrConnecting()) {
Log.e(TAG, "checkConnection - no connection found");
}
}
/**
* The main process method, which will be called by the Worker in the AsyncTask background
* thread.