From 72b84a23c994a16c2e1154ab510fd8669cd38b56 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 1 Dec 2016 17:10:27 -0700 Subject: [PATCH] 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 --- .../src/com/android/systemui/screenshot/GlobalScreenshot.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java index d7894772454dd..0eef864c7b01c 100644 --- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java +++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java @@ -323,7 +323,8 @@ class SaveImageInBackgroundTask extends AsyncTask { // 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();