@Nullable
      @Override
      public Void then(Task<EncodedImage> task) throws Exception {
        if (isTaskCancelled(task)) {
          listener.onProducerFinishWithCancellation(producerContext, PRODUCER_NAME, null);
          consumer.onCancellation();
        } else if (task.isFaulted()) {
          listener.onProducerFinishWithFailure(
              producerContext, PRODUCER_NAME, task.getError(), null);
          mInputProducer.produceResults(consumer, producerContext);
        } else {
          EncodedImage cachedReference = task.getResult();
          if (cachedReference != null) {
            listener.onProducerFinishWithSuccess(
                producerContext,
                PRODUCER_NAME,
                getExtraMap(listener, producerContext, true, cachedReference.getSize()));
            listener.onUltimateProducerReached(producerContext, PRODUCER_NAME, true);
            producerContext.putOriginExtra("disk");
            producerContext.putExtra(HasExtraData.KEY_ENCODED_SIZE, cachedReference.getSize());
            producerContext.putExtra(HasExtraData.KEY_ENCODED_WIDTH, cachedReference.getWidth());
            producerContext.putExtra(HasExtraData.KEY_ENCODED_HEIGHT, cachedReference.getHeight());
            consumer.onProgressUpdate(1);
            consumer.onNewResult(cachedReference, Consumer.IS_LAST);
            cachedReference.close();
          } else {
            listener.onProducerFinishWithSuccess(
                producerContext, PRODUCER_NAME, getExtraMap(listener, producerContext, false, 0));
            mInputProducer.produceResults(consumer, producerContext);
          }
        }
        return null;
      }
Disk cache read producer.

<p>This producer looks in the disk cache for the requested image. If the image is found, then it
is passed to the consumer. If the image is not found, then the request is passed to the next
producer in the sequence. Any results that the producer returns are passed to the consumer.

<p>This implementation delegates disk cache requests to BufferedDiskCache.

<p>This producer is currently used only if the media variations experiment is turned on, to
enable another producer to sit between cache read and write.
imagepipeline/src/main/java/com/facebook/imagepipeline/producers/DiskCacheReadProducer.java