@VisibleForTesting
  @Nullable
  ExifInterface getExifInterface(Uri uri) {
    final @Nullable String realPath = UriUtil.getRealPathFromUri(mContentResolver, uri);
    if (realPath == null) {
      return null;
    }
    try {
      if (canReadAsFile(realPath)) {
        return new ExifInterface(realPath);
      } else {
        AssetFileDescriptor assetFileDescriptor =
            UriUtil.getAssetFileDescriptor(mContentResolver, uri);
        if (assetFileDescriptor != null && Build.VERSION.SDK_INT >= 24) {
          final ExifInterface exifInterface =
              (new Api24Utils()).getExifInterface(assetFileDescriptor.getFileDescriptor());
          assetFileDescriptor.close();
          return exifInterface;
        }
      }
    } catch (IOException e) {
      // If we cannot get the exif interface, return null as there is no thumbnail available
    } catch (StackOverflowError e) {
      // Device-specific issue when loading huge images
      FLog.e(LocalExifThumbnailProducer.class, "StackOverflowError in ExifInterface constructor");
    }
    return null;
  }
Checks whether the producer may be able to produce images of the specified size. This makes no
promise about being able to produce images for a particular source, only generally being able
to produce output of the desired resolution.

<p>In this case, assumptions are made about the common size of EXIF thumbnails which is that
they may be up to 512 pixels in each dimension.

@param resizeOptions the resize options from the current request
@return true if the producer can meet these needs
imagepipeline/src/main/java/com/facebook/imagepipeline/producers/LocalExifThumbnailProducer.java