@Override
    protected void onNewResultImpl(
        @Nullable CloseableReference<CloseableImage> newResult, @Status int status) {
      // ignore invalid intermediate results and forward the null result if last
      if (newResult == null) {
        if (isLast(status)) {
          getConsumer().onNewResult(null, status);
        }
        return;
      }
      // ignore intermediate results for non-repeated postprocessors
      if (isNotLast(status) && !mIsRepeatedProcessor) {
        return;
      }
      // cache, if needed, and forward the new result
      CloseableReference<CloseableImage> newCachedResult = null;
      if (mIsBitmapCacheEnabledForWrite) {
        newCachedResult = mMemoryCache.cache(mCacheKey, newResult);
      }
      try {
        getConsumer().onProgressUpdate(1f);
        getConsumer().onNewResult((newCachedResult != null) ? newCachedResult : newResult, status);
      } finally {
        CloseableReference.closeSafely(newCachedResult);
      }
    }
Memory cache producer for the bitmap memory cache.
imagepipeline/src/main/java/com/facebook/imagepipeline/producers/PostprocessedBitmapMemoryCacheProducer.java