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

Commit e4477769 authored by Shai Barack's avatar Shai Barack
Browse files

Removed Message recycle check relaxation for pre-Lollipop

Lollipop is now 10 years old and apps don't (can't?) target it.

Bug: 17391969
Flag: EXEMPT cleanup
Change-Id: Id43411c56092f29d4eb5586e764c6a80f3ba1023
parent 7ce70da5
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -7657,8 +7657,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.
@@ -313,13 +311,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>
@@ -330,12 +321,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();
    }