/** * @return true - if task should be interrupted; false - otherwise */ private boolean waitIfPaused() { AtomicBoolean pause = engine.getPause(); if (pause.get()) { synchronized (pause) { log(LOG_WAITING_FOR_RESUME); try { pause.wait(); } catch (InterruptedException e) { L.e(LOG_TASK_INTERRUPTED, memoryCacheKey); return true; } log(LOG_RESUME_AFTER_PAUSE); } } return checkTaskIsNotActual(); }
/** * @return true - if task should be interrupted; false - otherwise */ private boolean delayIfNeed() { if (options.shouldDelayBeforeLoading()) { log(LOG_DELAY_BEFORE_LOADING, options.getDelayBeforeLoading(), memoryCacheKey); try { Thread.sleep(options.getDelayBeforeLoading()); } catch (InterruptedException e) { L.e(LOG_TASK_INTERRUPTED, memoryCacheKey); return true; } return checkTaskIsNotActual(); } return false; }
Bitmap bmp; try { if (checkTaskIsNotActual()) return; if (bmp == null) return; if (checkTaskIsNotActual() || checkTaskIsInterrupted()) return; if (checkTaskIsNotActual() || checkTaskIsInterrupted()) return;
if (!checkTaskIsNotActual()) { bitmap = decodeImage(imageUriForDecoding); if (bitmap == null) {