Stop pre-caching images if disallowed network becomes active.

This commit is contained in:
dosiecki 2015-08-31 20:07:25 -07:00
parent d1e5f24e39
commit b063d819d5

View file

@ -32,7 +32,10 @@ public class ImagePrefetchService extends SubService {
gotWork();
while ((ImageQueue.size() > 0) && PrefsUtils.isImagePrefetchEnabled(parent)) {
while (ImageQueue.size() > 0) {
if (! PrefsUtils.isImagePrefetchEnabled(parent)) return;
if (! PrefsUtils.isBackgroundNetworkAllowed(parent)) return;
startExpensiveCycle();
// on each batch, re-query the DB for images associated with yet-unread stories
// this is a bit expensive, but we are running totally async at a really low priority