@Override
    protected Bitmap doInBackground(Uri... params) {
        try {
            ParcelFileDescriptor descriptor = mResolver.openFileDescriptor(params[0], "r");
            if (descriptor == null) return null;
            FileDescriptor fileDescriptor = descriptor.getFileDescriptor();
            Bitmap bitmap = BitmapFactory.decodeFileDescriptor(fileDescriptor);
            descriptor.close();
            return bitmap;
        } catch (IOException e) {
            Log.e(TAG, "Failed to read bitmap", e);
        }
        return null;
    }
The {@link AsyncTask} handles:
 1. Inflate a fallback view when the requested image is not ready.
 2. Load the image from given uri generated from {@link BrowserServiceFileProvider}.
 3. Update the UI when image is ready.
To use this class:
 1. Override handlePreLoadingFallback() to inflate a fallback UI when image is not ready.
 2. Override onBitmapFileReady(Bitmap) to update the UI.
customtabs/src/android/support/customtabs/browseractions/BrowserServiceImageReadTask.java