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

Commit 6b73d378 authored by Hao Ke's avatar Hao Ke Committed by Automerger Merge Worker
Browse files

Merge "Added End-of-Parcel check API." am: 93b3eb84 am: 479f10d9 am: 258395cc am: 4e657826

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1876569

Change-Id: Ifc7f5b520cd39702ecb24bc419bee2caa3273412
parents 9cf43eab 4e657826
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -31815,6 +31815,7 @@ package android.os {
    method public int dataPosition();
    method public int dataSize();
    method public void enforceInterface(@NonNull String);
    method public void enforceNoDataAvail();
    method public boolean hasFileDescriptors();
    method public boolean hasFileDescriptors(int, int);
    method public byte[] marshall();
+13 −0
Original line number Diff line number Diff line
@@ -845,6 +845,19 @@ public final class Parcel {
        nativeEnforceInterface(mNativePtr, interfaceName);
    }

    /**
     * Verify there are no bytes left to be read on the Parcel.
     *
     * @throws BadParcelableException If the current position hasn't reached the end of the Parcel.
     * When used over binder, this exception should propagate to the caller.
     */
    public void enforceNoDataAvail() {
        final int n = dataAvail();
        if (n > 0) {
            throw new BadParcelableException("Parcel data not fully consumed, unread size: " + n);
        }
    }

    /**
     * Writes the work source uid to the request headers.
     *