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

Commit 7c18bbee authored by Steven Moreland's avatar Steven Moreland
Browse files

Parcel: hasFileDescriptors warning

Calling this API on system parcelables may lead to
app compat issues. Call this out, since the API
is public. Call it out on hasBinders for good
measure.

Bugs: michaelwr@ (came up on internal code review)
Test: N/A
Change-Id: I94ad82129aca70d18b7ce8f6081e90e3e529731d
parent 9fe82166
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -892,6 +892,12 @@ public final class Parcel {

    /**
     * Report whether the parcel contains any marshalled file descriptors.
     *
     * WARNING: Parcelable definitions change over time. Unless you define
     * a Parcelable yourself OR the Parcelable explicitly guarantees that
     * it would never include such objects, you should not expect the return
     * value to stay the same, and your code should continue to work even
     * if the return value changes.
     */
    public boolean hasFileDescriptors() {
        return nativeHasFileDescriptors(mNativePtr);
@@ -901,6 +907,12 @@ public final class Parcel {
     * Report whether the parcel contains any marshalled file descriptors in the range defined by
     * {@code offset} and {@code length}.
     *
     * WARNING: Parcelable definitions change over time. Unless you define
     * a Parcelable yourself OR the Parcelable explicitly guarantees that
     * it would never include such objects, you should not expect the return
     * value to stay the same, and your code should continue to work even
     * if the return value changes.
     *
     * @param offset The offset from which the range starts. Should be between 0 and
     *     {@link #dataSize()}.
     * @param length The length of the range. Should be between 0 and {@link #dataSize()} - {@code
@@ -921,6 +933,12 @@ public final class Parcel {
     * <p>For most cases, it will use the self-reported {@link Parcelable#describeContents()} method
     * for that.
     *
     * WARNING: Parcelable definitions change over time. Unless you define
     * a Parcelable yourself OR the Parcelable explicitly guarantees that
     * it would never include such objects, you should not expect the return
     * value to stay the same, and your code should continue to work even
     * if the return value changes.
     *
     * @throws IllegalArgumentException if you provide any object not supported by above methods
     *     (including if the unsupported object is inside a nested container).
     *
@@ -990,6 +1008,13 @@ public final class Parcel {
     *
     * @throws UnsupportedOperationException if binder kernel driver was disabled or if method was
     *                                       invoked in case of Binder RPC protocol.
     *
     * WARNING: Parcelable definitions change over time. Unless you define
     * a Parcelable yourself OR the Parcelable explicitly guarantees that
     * it would never include such objects, you should not expect the return
     * value to stay the same, and your code should continue to work even
     * if the return value changes.
     *
     * @hide
     */
    public boolean hasBinders() {
@@ -1000,6 +1025,12 @@ public final class Parcel {
     * Report whether the parcel contains any marshalled {@link IBinder} objects in the range
     * defined by {@code offset} and {@code length}.
     *
     * WARNING: Parcelable definitions change over time. Unless you define
     * a Parcelable yourself OR the Parcelable explicitly guarantees that
     * it would never include such objects, you should not expect the return
     * value to stay the same, and your code should continue to work even
     * if the return value changes.
     *
     * @param offset The offset from which the range starts. Should be between 0 and
     *               {@link #dataSize()}.
     * @param length The length of the range. Should be between 0 and {@link #dataSize()} - {@code