@Override
    public void onNewResultImpl(
        @Nullable CloseableReference<CloseableImage> newResult, @Status int status) {
      try {
        if (FrescoSystrace.isTracing()) {
          FrescoSystrace.beginSection("BitmapProbeProducer#onNewResultImpl");
        }

        // intermediate or null are not cached, so we just forward them
        if (isNotLast(status) || newResult == null || statusHasAnyFlag(status, IS_PARTIAL_RESULT)) {
          getConsumer().onNewResult(newResult, status);
          return;
        }

        final ImageRequest imageRequest = mProducerContext.getImageRequest();
        final CacheKey cacheKey =
            mCacheKeyFactory.getEncodedCacheKey(imageRequest, mProducerContext.getCallerContext());
        String producerContextExtra = mProducerContext.getExtra(HasExtraData.KEY_ORIGIN);
        if (producerContextExtra != null && producerContextExtra.equals("memory_bitmap")) {
          if (mProducerContext
                  .getImagePipelineConfig()
                  .getExperiments()
                  .isEncodedMemoryCacheProbingEnabled()
              && !mEncodedMemoryCacheHistory.contains(cacheKey)) {
            mEncodedMemoryCache.probe(cacheKey);
            mEncodedMemoryCacheHistory.add(cacheKey);
          }
          if (mProducerContext.getImagePipelineConfig().getExperiments().isDiskCacheProbingEnabled()
              && !mDiskCacheHistory.contains(cacheKey)) {
            final boolean isSmallRequest =
                (imageRequest.getCacheChoice() == ImageRequest.CacheChoice.SMALL);
            final DiskCachesStore diskCachesStore = mDiskCachesStoreSupplier.get();
            final BufferedDiskCache preferredCache =
                isSmallRequest
                    ? diskCachesStore.getSmallImageBufferedDiskCache()
                    : diskCachesStore.getMainBufferedDiskCache();
            preferredCache.addKeyForAsyncProbing(cacheKey);
            mDiskCacheHistory.add(cacheKey);
          }
        }

        getConsumer().onNewResult(newResult, status);

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