Grant Uri permissions for new screenshots.

The receiving app may not have the needed permissions to see the
screenshot when launched.

Test: builds, boots, no longer logs
Bug: 33275110
Change-Id: I8b9b4fea2f78f37af543a90309cb34994366850b
This commit is contained in:
Jeff Sharkey
2016-12-01 17:10:27 -07:00
parent fb833f38a0
commit 72b84a23c9

View File

@@ -323,7 +323,8 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
// Create the intent to show the screenshot in gallery
Intent launchIntent = new Intent(Intent.ACTION_VIEW);
launchIntent.setDataAndType(mParams.imageUri, "image/png");
launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
launchIntent.setFlags(
Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_GRANT_READ_URI_PERMISSION);
final long now = System.currentTimeMillis();