Merge "Fix permissions for internal links."

This commit is contained in:
Treehugger Robot
2022-08-12 02:44:31 +00:00
committed by Gerrit Code Review
2 changed files with 5 additions and 2 deletions

View File

@@ -98,7 +98,9 @@ public class SettingsLicenseActivity extends FragmentActivity implements
intent.setDataAndType(uri, "text/html");
intent.putExtra(Intent.EXTRA_TITLE, getString(R.string.settings_license_activity_title));
if (ContentResolver.SCHEME_CONTENT.equals(uri.getScheme())) {
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(
Intent.FLAG_GRANT_READ_URI_PERMISSION
| Intent.FLAG_GRANT_PREFIX_URI_PERMISSION);
}
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setPackage("com.android.htmlviewer");

View File

@@ -92,7 +92,8 @@ public class SettingsLicenseActivityTest {
"text/html");
intent.putExtra(Intent.EXTRA_TITLE, mActivity.getString(
R.string.settings_license_activity_title));
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(
Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION);
intent.addCategory(Intent.CATEGORY_DEFAULT);
intent.setPackage("com.android.htmlviewer");