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

Commit 04ec6f4f authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Only send EXTRA_STACK for private intent.

Since it's a private Parcelable class, we can't send it to other
third-party apps, since they won't know how to unpack it.

Bug: 22255387
Change-Id: Ie2ea6cf72b733bd122eb3581a5df295cec608425
parent 98329459
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -720,13 +720,14 @@ public class DocumentsActivity extends BaseActivity {

        if (mState.action == ACTION_GET_CONTENT) {
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
        } else if (mState.action == ACTION_OPEN_TREE ||
                   mState.action == ACTION_OPEN_COPY_DESTINATION) {
        } else if (mState.action == ACTION_OPEN_TREE) {
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION
                    | Intent.FLAG_GRANT_WRITE_URI_PERMISSION
                    | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION
                    | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION);
            // TODO: Move passing the stack to the separate ACTION_COPY action once it's implemented.
        } else if (mState.action == ACTION_OPEN_COPY_DESTINATION) {
            // Picking a copy destination is only used internally by us, so we
            // don't need to extend permissions to the caller.
            intent.putExtra(CopyService.EXTRA_STACK, (Parcelable) mState.stack);
        } else {
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION