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

Commit f86c86cd authored by Miranda Kephart's avatar Miranda Kephart Committed by Android (Google) Code Review
Browse files

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

parents 42121eea cf85186f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -246,7 +246,9 @@ class SaveImageInBackgroundTask extends AsyncTask<Void, Void, Void> {
                    new ClipData.Item(uri));
            sharingIntent.setClipData(clipdata);
            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
            // 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_GRANT_READ_URI_PERMISSION);


            // cancel current pending intent (if any) since clipData isn't used for matching
            PendingIntent pendingIntent = PendingIntent.getActivityAsUser(
                    context, 0, sharingChooserIntent,