@UiThread
    public static Uri generateUri(Context context, Bitmap bitmap, String name, int version) {
        String filename = name + "_" + Integer.toString(version);
        Uri uri = generateUri(context, filename);
        boolean shouldSaveImage;
        synchronized (sLatchMapLock) {
            shouldSaveImage = sFilesInSerialization.add(uri);
        }
        if (shouldSaveImage) {
            FileSaveTask fileSaveTask = new FileSaveTask(context, filename, bitmap, uri);
            fileSaveTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        }
        return uri;
    }
Request a {@link Uri} used to access the bitmap through the file provider.
@param context The {@link Context} used to generate the uri, save the bitmap and grant the
               read permission.
@param bitmap The {@link Bitmap} to be saved and access through the file provider.
@param name The name of the bitmap.
@param version The version number of the bitmap. Note: This plus the name decides the
                filename of the bitmap. If it matches with existing file, bitmap will skip
                saving.
@return The uri to access the bitmap.
customtabs/src/android/support/customtabs/browseractions/BrowserServiceFileProvider.java