diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-03-27 10:34:24 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2012-03-27 10:34:24 -0700 |
commit | f27ea66114569d233c65cb895543668f3202ca19 (patch) | |
tree | d7c8bd0273fbf7b44035b8b5abb5d18edeac9c6c /core/java | |
parent | 9d4b8811c1aba7cb592d5bacba67f793043a7219 (diff) | |
download | frameworks_base-f27ea66114569d233c65cb895543668f3202ca19.zip frameworks_base-f27ea66114569d233c65cb895543668f3202ca19.tar.gz frameworks_base-f27ea66114569d233c65cb895543668f3202ca19.tar.bz2 |
Avoid ClassCast when migrating ACTION_SEND extras.
Bug: 6231948
Change-Id: I008195fa973517446b2400ed3f59af0cbf0fc925
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/content/Intent.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 1c9ef38..a0d0271 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -6483,7 +6483,12 @@ public class Intent implements Parcelable, Cloneable { final String action = getAction(); if (ACTION_SEND.equals(action)) { - final Uri stream = getParcelableExtra(EXTRA_STREAM); + final Uri stream; + try { + stream = getParcelableExtra(EXTRA_STREAM); + } catch (ClassCastException e) { + return; + } if (stream != null) { final ClipData clipData = new ClipData( null, new String[] { getType() }, new ClipData.Item(stream)); @@ -6493,7 +6498,12 @@ public class Intent implements Parcelable, Cloneable { } } else if (ACTION_SEND_MULTIPLE.equals(action)) { - final ArrayList<Uri> streams = getParcelableArrayListExtra(EXTRA_STREAM); + final ArrayList<Uri> streams; + try { + streams = getParcelableArrayListExtra(EXTRA_STREAM); + } catch (ClassCastException e) { + return; + } if (streams != null && streams.size() > 0) { final Uri firstStream = streams.get(0); final ClipData clipData = new ClipData( |