Merge "Propagate write_uri perms from screenshot to sharesheet" into tm-dev am: f86c86cd8f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17571465 Change-Id: Idb98092d98284e8b6e9ffbdd8dcb1495b8009e0d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -246,7 +246,9 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
|
|||||||
new ClipData.Item(uri));
|
new ClipData.Item(uri));
|
||||||
sharingIntent.setClipData(clipdata);
|
sharingIntent.setClipData(clipdata);
|
||||||
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
|
sharingIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
|
||||||
sharingIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
sharingIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||||
|
.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
|
||||||
|
|
||||||
|
|
||||||
// Make sure pending intents for the system user are still unique across users
|
// Make sure pending intents for the system user are still unique across users
|
||||||
// by setting the (otherwise unused) request code to the current user id.
|
// by setting the (otherwise unused) request code to the current user id.
|
||||||
@@ -256,6 +258,7 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
|
|||||||
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK)
|
.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||||
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||||
|
|
||||||
|
|
||||||
// cancel current pending intent (if any) since clipData isn't used for matching
|
// cancel current pending intent (if any) since clipData isn't used for matching
|
||||||
PendingIntent pendingIntent = PendingIntent.getActivityAsUser(
|
PendingIntent pendingIntent = PendingIntent.getActivityAsUser(
|
||||||
context, 0, sharingChooserIntent,
|
context, 0, sharingChooserIntent,
|
||||||
|
|||||||
Reference in New Issue
Block a user