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

Commit 00348dc3 authored by Shai Barack's avatar Shai Barack Committed by Android (Google) Code Review
Browse files

Merge "Removed Message recycle check relaxation for pre-Lollipop" into main

parents 81f43711 e4477769
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -7658,8 +7658,6 @@ public final class ActivityThread extends ClientTransactionHandler
        UtilConfig.setThrowExceptionForUpperArrayOutOfBounds(
                data.appInfo.targetSdkVersion >= Build.VERSION_CODES.Q);

        Message.updateCheckRecycle(data.appInfo.targetSdkVersion);

        // Supply the targetSdkVersion to the UI rendering module, which may
        // need it in cases where it does not have access to the appInfo.
        android.graphics.Compatibility.setTargetSdkVersion(data.appInfo.targetSdkVersion);
+2 −14
Original line number Diff line number Diff line
@@ -167,8 +167,6 @@ public final class Message implements Parcelable {

    private static final int MAX_POOL_SIZE = 50;

    private static boolean gCheckRecycle = true;

    /**
     * Return a new Message instance from the global pool. Allows us to
     * avoid allocating new objects in many cases.
@@ -315,13 +313,6 @@ public final class Message implements Parcelable {
        return m;
    }

    /** @hide */
    public static void updateCheckRecycle(int targetSdkVersion) {
        if (targetSdkVersion < Build.VERSION_CODES.LOLLIPOP) {
            gCheckRecycle = false;
        }
    }

    /**
     * Return a Message instance to the global pool.
     * <p>
@@ -332,12 +323,9 @@ public final class Message implements Parcelable {
     */
    public void recycle() {
        if (isInUse()) {
            if (gCheckRecycle) {
            throw new IllegalStateException("This message cannot be recycled because it "
                    + "is still in use.");
        }
            return;
        }
        recycleUnchecked();
    }