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

Commit 98636f80 authored by Steven Moreland's avatar Steven Moreland
Browse files

Revert "Assert Parcel not in pool when used (partial reland)"

This reverts commit 0bb6108b.

Reason for revert: b/390748425

Fixes: 390748425
Bug: 381155347

Change-Id: I606123c67884d96c929ad21adce5303984d56a07
parent 0bb6108b
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ import com.android.internal.util.ArrayUtils;

import dalvik.annotation.optimization.CriticalNative;
import dalvik.annotation.optimization.FastNative;
import dalvik.annotation.optimization.NeverInline;

import libcore.util.SneakyThrow;

@@ -629,19 +628,6 @@ public final class Parcel {
        }
    }

    @NeverInline
    private void errorUsedWhileRecycling() {
        String error = "Parcel used while recycled. "
                + Log.getStackTraceString(new Throwable())
                + " Original recycle call (if DEBUG_RECYCLE): ", mStack;
        Log.wtf(TAG, error);
        // TODO(b/381155347): harder error
    }

    private void assertNotRecycled() {
        if (mRecycled) errorUsedWhileRecycling();
    }

    /**
     * Set a {@link ReadWriteHelper}, which can be used to avoid having duplicate strings, for
     * example.
@@ -1194,7 +1180,6 @@ public final class Parcel {
     * growing dataCapacity() if needed.
     */
    public final void writeInt(int val) {
        assertNotRecycled();
        int err = nativeWriteInt(mNativePtr, val);
        if (err != OK) {
            nativeSignalExceptionForError(err);
@@ -3297,7 +3282,6 @@ public final class Parcel {
     * Read an integer value from the parcel at the current dataPosition().
     */
    public final int readInt() {
        assertNotRecycled();
        return nativeReadInt(mNativePtr);
    }