Commit d40b01f4 authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

[WebLayer] Fix FileProvider not having a unique authority

This causes issues when trying to install multiple apps that are using
WebLayer.

Bug: 1017938
Change-Id: Iac2a12d42b565c043e68b56aac8f7d58fb109bea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880048
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Auto-Submit: Clark DuVall <cduvall@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709276}
parent 5078b99d
......@@ -44,12 +44,14 @@ public final class WebLayerImpl extends IWebLayer.Stub {
private static class FileProviderHelper implements ContentUriUtils.FileProviderUtil {
// Keep this variable in sync with the value defined in AndroidManifest.xml.
private static final String API_AUTHORITY = "org.chromium.weblayer.client.FileProvider";
private static final String API_AUTHORITY_SUFFIX =
".org.chromium.weblayer.client.FileProvider";
@Override
public Uri getContentUriFromFile(File file) {
Context appContext = ContextUtils.getApplicationContext();
return FileProvider.getUriForFile(appContext, API_AUTHORITY, file);
return FileProvider.getUriForFile(
appContext, appContext.getPackageName() + API_AUTHORITY_SUFFIX, file);
}
}
......
......@@ -46,7 +46,7 @@
{% endfor %}
<provider android:name="android.support.v4.content.FileProvider"
android:authorities="org.chromium.weblayer.client.FileProvider"
android:authorities="${applicationId}.org.chromium.weblayer.client.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment