Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc75aae4 authored by Miranda Kephart's avatar Miranda Kephart Committed by Automerger Merge Worker
Browse files

Merge "Propagate write_uri perms from screenshot to sharesheet" into tm-dev...

Merge "Propagate write_uri perms from screenshot to sharesheet" into tm-dev am: f86c86cd am: 3987b4d7

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17571465



Change-Id: I47125a5185ac9bbc3bdfb9ba61584f734e0faa9f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a948eb1b 3987b4d7
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -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,