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

Commit 8b5f8436 authored by Achim Thesmann's avatar Achim Thesmann Committed by Android (Google) Code Review
Browse files

Merge "Tweak WTF logging of Parcel size mismatch" into main

parents 31ca77b1 43288ab4
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -4716,12 +4716,14 @@ public final class Parcel {
            object = readValue(type, loader, clazz, itemTypes);
            int actual = dataPosition() - start;
            if (actual != length) {
                boolean failOnMismatch = failOnParcelSizeMismatch();
                String msg = "Unparcelling of " + object + " of type " + Parcel.valueTypeToString(
                        type) + "  consumed " + actual + " bytes, but " + length + " expected.";
                if (failOnParcelSizeMismatch()) {
                        type) + "  consumed " + actual + " bytes, but " + length + " expected."
                        + (failOnMismatch ? " [throwing]" : " [ignored]");
                Slog.wtfStack(TAG, msg);
                if (failOnMismatch) {
                    throw new BadParcelableException(msg);
                }
                Slog.wtfStack(TAG, msg);
            }
        } else {
            object = readValue(type, loader, clazz, itemTypes);