diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2016-03-09 22:30:56 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2016-03-16 14:45:26 -0600 |
| commit | d136e51a99df5275eaafdde407e89e78c02b829b (patch) | |
| tree | 6f8489a5c9ac0280e04037c259e12a266fd16443 /core/java/android/os/BadParcelableException.java | |
| parent | 08e5936485a830ee80c4bf42a8402e1d13a783f9 (diff) | |
Defuse Bundles parsed by the system process.
It's easy for apps to throw custom Parcelables into Bundles, but
if the system tries peeking inside one of these Bundles, it triggers
a BadParcelableException. If that Bundle was passed away from the
Binder thread that delivered it into the system, we end up with a
nasty runtime restart.
This change mitigates this trouble by "defusing" any Bundles parsed by
the system server. That is, if it encounters BadParcelableException
while unpacking a Bundle, it logs and delivers an empty Bundle as
the result.
Simultaneously, to help catch the system process sticking its
fingers into Bundles that are destined for other processes, a Bundle
now tracks if it's "defusable." For example, any Intents delivered
through ActivityThread are marked as being defusable, since they've
arrived at their final destination. Any other Bundles are considered
to be "in transit" and we log if the system tries unparceling them.
Merges several Parcel boolean fields into a flags int. Add better
docs to several classes.
Bug: 27581063
Change-Id: I28cf3e7439503b5dc9a429bafae5eb48f21f0d93
Diffstat (limited to 'core/java/android/os/BadParcelableException.java')
| -rw-r--r-- | core/java/android/os/BadParcelableException.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/java/android/os/BadParcelableException.java b/core/java/android/os/BadParcelableException.java index a1c5bb251197..7e0b1a591d0a 100644 --- a/core/java/android/os/BadParcelableException.java +++ b/core/java/android/os/BadParcelableException.java @@ -15,11 +15,15 @@ */ package android.os; + import android.util.AndroidRuntimeException; /** - * The object you are calling has died, because its hosting process - * no longer exists. + * Exception thrown when a {@link Parcelable} is malformed or otherwise invalid. + * <p> + * This is typically encountered when a custom {@link Parcelable} object is + * passed to another process that doesn't have the same {@link Parcelable} class + * in its {@link ClassLoader}. */ public class BadParcelableException extends AndroidRuntimeException { public BadParcelableException(String msg) { |
