Merge pull request #55 from NativeScript/hhristov/remove-permission-check

Remove the code that requires ACCESS_NETWORK_STATE
This commit is contained in:
Vasil Chimev
2016-10-07 11:53:45 +03:00
committed by GitHub

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.