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

Commit dc7643d8 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android Git Automerger
Browse files

am 40bd46ae: am 9cb660fa: Merge "Guard against apps breaking CHOOSER contract." into jb-dev

* commit '40bd46ae':
  Guard against apps breaking CHOOSER contract.
parents 891a8446 40bd46ae
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -6653,11 +6653,12 @@ public class Intent implements Parcelable, Cloneable {

        final String action = getAction();
        if (ACTION_CHOOSER.equals(action)) {
            try {
                // Inspect target intent to see if we need to migrate
                final Intent target = getParcelableExtra(EXTRA_INTENT);
            if (target.migrateExtraStreamToClipData()) {
                // Since we migrated in child, we need to promote ClipData and
                // flags to ourselves to grant.
                if (target != null && target.migrateExtraStreamToClipData()) {
                    // Since we migrated in child, we need to promote ClipData
                    // and flags to ourselves to grant.
                    setClipData(target.getClipData());
                    addFlags(target.getFlags()
                            & (FLAG_GRANT_READ_URI_PERMISSION | FLAG_GRANT_WRITE_URI_PERMISSION));
@@ -6665,6 +6666,8 @@ public class Intent implements Parcelable, Cloneable {
                } else {
                    return false;
                }
            } catch (ClassCastException e) {
            }

        } else if (ACTION_SEND.equals(action)) {
            try {