Loading core/java/android/content/Intent.java +22 −13 Original line number Original line Diff line number Diff line Loading @@ -7498,23 +7498,32 @@ public class Intent implements Parcelable, Cloneable { final String action = getAction(); final String action = getAction(); if (ACTION_CHOOSER.equals(action)) { if (ACTION_CHOOSER.equals(action)) { // Inspect contained intents to see if we need to migrate extras. We // don't promote ClipData to the parent, since ChooserActivity will // already start the picked item as the caller, and we can't combine // the flags in a safe way. boolean migrated = false; try { try { // Inspect target intent to see if we need to migrate final Intent intent = getParcelableExtra(EXTRA_INTENT); final Intent target = getParcelableExtra(EXTRA_INTENT); if (intent != null) { if (target != null && target.migrateExtraStreamToClipData()) { migrated |= intent.migrateExtraStreamToClipData(); // Since we migrated in child, we need to promote ClipData } // and flags to ourselves to grant. } catch (ClassCastException e) { setClipData(target.getClipData()); } addFlags(target.getFlags() & (FLAG_GRANT_READ_URI_PERMISSION try { | FLAG_GRANT_WRITE_URI_PERMISSION final Parcelable[] intents = getParcelableArrayExtra(EXTRA_INITIAL_INTENTS); | FLAG_GRANT_PERSISTABLE_URI_PERMISSION if (intents != null) { | FLAG_GRANT_PREFIX_URI_PERMISSION)); for (int i = 0; i < intents.length; i++) { return true; final Intent intent = (Intent) intents[i]; } else { if (intent != null) { return false; migrated |= intent.migrateExtraStreamToClipData(); } } } } } catch (ClassCastException e) { } catch (ClassCastException e) { } } return migrated; } else if (ACTION_SEND.equals(action)) { } else if (ACTION_SEND.equals(action)) { try { try { Loading Loading
core/java/android/content/Intent.java +22 −13 Original line number Original line Diff line number Diff line Loading @@ -7498,23 +7498,32 @@ public class Intent implements Parcelable, Cloneable { final String action = getAction(); final String action = getAction(); if (ACTION_CHOOSER.equals(action)) { if (ACTION_CHOOSER.equals(action)) { // Inspect contained intents to see if we need to migrate extras. We // don't promote ClipData to the parent, since ChooserActivity will // already start the picked item as the caller, and we can't combine // the flags in a safe way. boolean migrated = false; try { try { // Inspect target intent to see if we need to migrate final Intent intent = getParcelableExtra(EXTRA_INTENT); final Intent target = getParcelableExtra(EXTRA_INTENT); if (intent != null) { if (target != null && target.migrateExtraStreamToClipData()) { migrated |= intent.migrateExtraStreamToClipData(); // Since we migrated in child, we need to promote ClipData } // and flags to ourselves to grant. } catch (ClassCastException e) { setClipData(target.getClipData()); } addFlags(target.getFlags() & (FLAG_GRANT_READ_URI_PERMISSION try { | FLAG_GRANT_WRITE_URI_PERMISSION final Parcelable[] intents = getParcelableArrayExtra(EXTRA_INITIAL_INTENTS); | FLAG_GRANT_PERSISTABLE_URI_PERMISSION if (intents != null) { | FLAG_GRANT_PREFIX_URI_PERMISSION)); for (int i = 0; i < intents.length; i++) { return true; final Intent intent = (Intent) intents[i]; } else { if (intent != null) { return false; migrated |= intent.migrateExtraStreamToClipData(); } } } } } catch (ClassCastException e) { } catch (ClassCastException e) { } } return migrated; } else if (ACTION_SEND.equals(action)) { } else if (ACTION_SEND.equals(action)) { try { try { Loading