code: public AnimatedImageResult build() {
      try {
        return new AnimatedImageResult(this);
      } finally {
        CloseableReference.closeSafely(mPreviewBitmap);
        mPreviewBitmap = null;
        CloseableReference.closeSafely(mDecodedFrames);
        mDecodedFrames = null;
      }
    }
docs: Builds the {@link AnimatedImageResult}. The preview bitmap and the decoded frames are closed
  after build is called, so this should not be called more than once or those fields will be lost
  after the first call.
  
  @return the result