@Override
  public synchronized void clear() {
    for (int i = 0; i < mBitmapSparseArray.size(); i++) {
      CloseableReference.closeSafely(mBitmapSparseArray.valueAt(i));
      if (mFrameCacheListener != null) {
        mFrameCacheListener.onFrameEvicted(this, mBitmapSparseArray.keyAt(i));
      }
    }
    mBitmapSparseArray.clear();
  }
This naive implementation does not share Fresco's bitmap cache but has its own LRU. This should
just be used for testing. The cache does not support fallback frames or frame re-using.
samples/animation2/src/main/java/com/facebook/samples/animation2/bitmap/NaiveCacheAllFramesCachingBackend.java