mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Remove the code that requires ACCESS_NETWORK_STATE
This commit is contained in:
@@ -59,7 +59,6 @@ public class Fetcher extends Resizer {
|
|||||||
*/
|
*/
|
||||||
public Fetcher(Context context) {
|
public Fetcher(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
checkConnection(context);
|
|
||||||
mHttpCacheDir = Cache.getDiskCacheDir(context, HTTP_CACHE_DIR);
|
mHttpCacheDir = Cache.getDiskCacheDir(context, HTTP_CACHE_DIR);
|
||||||
mPackageName = context.getPackageName();
|
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
|
* The main process method, which will be called by the Worker in the AsyncTask background
|
||||||
* thread.
|
* thread.
|
||||||
|
|||||||
Reference in New Issue
Block a user