diff options
| author | 2025-01-14 20:19:48 +0000 | |
|---|---|---|
| committer | 2025-01-14 20:20:55 +0000 | |
| commit | e6e4f3d6552025e6dac34d47e7ba4dbe81c098fe (patch) | |
| tree | 3db688b274d3c2340d30f094824526293ccdfba7 | |
| parent | 73a93318fd138f29c26274eef7811a76a90599fb (diff) | |
Parcel: readValue harder error
Bug: 384586487
Test: boot
Change-Id: Ifa8b7551246a485f3622bb223ce0aec45dd178ac
| -rw-r--r-- | core/java/android/os/Parcel.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/os/Parcel.java b/core/java/android/os/Parcel.java index 4aa74621bd62..3c4139d39762 100644 --- a/core/java/android/os/Parcel.java +++ b/core/java/android/os/Parcel.java @@ -4623,9 +4623,11 @@ public final class Parcel { object = readValue(type, loader, clazz, itemTypes); int actual = dataPosition() - start; if (actual != length) { - Slog.wtfStack(TAG, - "Unparcelling of " + object + " of type " + Parcel.valueTypeToString(type) - + " consumed " + actual + " bytes, but " + length + " expected."); + String error = "Unparcelling of " + object + " of type " + + Parcel.valueTypeToString(type) + " consumed " + actual + + " bytes, but " + length + " expected."; + Slog.wtfStack(TAG, error); + throw new BadParcelableException(error); } } else { object = readValue(type, loader, clazz, itemTypes); |