@Override
    public void onNewResultImpl(@Nullable EncodedImage newResult, @Status int status) {
      try {
        if (FrescoSystrace.isTracing()) {
          FrescoSystrace.beginSection("EncodedProbeProducer#onNewResultImpl");
        }
        // intermediate, null or uncacheable results are not cached, so we just forward them
        // as well as the images with unknown format which could be html response from the server
        if (isNotLast(status)
            || newResult == null
            || statusHasAnyFlag(status, DO_NOT_CACHE_ENCODED | IS_PARTIAL_RESULT)
            || newResult.getImageFormat() == ImageFormat.UNKNOWN) {
          getConsumer().onNewResult(newResult, status);
          return;
        }

        final ImageRequest imageRequest = mProducerContext.getImageRequest();
        final CacheKey cacheKey =
            mCacheKeyFactory.getEncodedCacheKey(imageRequest, mProducerContext.getCallerContext());

        mEncodedMemoryCacheHistory.add(cacheKey);
        if ("memory_encoded".equals(mProducerContext.getExtra(HasExtraData.KEY_ORIGIN))) {
          if (!mDiskCacheHistory.contains(cacheKey)) {
            final boolean isSmallRequest =
                (imageRequest.getCacheChoice() == ImageRequest.CacheChoice.SMALL);
            final DiskCachesStore diskCachesStore = mDefaultBufferedDiskCache.get();
            final BufferedDiskCache preferredCache =
                isSmallRequest
                    ? diskCachesStore.getSmallImageBufferedDiskCache()
                    : diskCachesStore.getMainBufferedDiskCache();
            preferredCache.addKeyForAsyncProbing(cacheKey);
            mDiskCacheHistory.add(cacheKey);
          }
        } else if ("disk".equals(mProducerContext.getExtra(HasExtraData.KEY_ORIGIN))) {
          // image was fetched from disk cache, therefore it was probed in disk cache by default
          mDiskCacheHistory.add(cacheKey);
        }

        getConsumer().onNewResult(newResult, status);

      } finally {
        if (FrescoSystrace.isTracing()) {
          FrescoSystrace.endSection();
        }
      }
    }
Probe producer for brobing disk cache on encoded memory cache hit requests.
imagepipeline/src/main/java/com/facebook/imagepipeline/producers/EncodedProbeProducer.java