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

Commit 426c0248 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "MessageHeap.peek() should check heapIndex before removing a message" into main

parents 033a078e 49b28db6
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -87,8 +87,6 @@ public final class MessageStack {
        Message quittingMsg = Message.obtain();
        quittingMsg.obj = QUITTING_NODE_OBJ;
        quittingMsg.when = when;
        /* Should never go into the heap, initialize idx to an impossible value */
        quittingMsg.heapIndex = -1;
        final boolean ret = pushMessage(quittingMsg);
        if (!ret) {
            quittingMsg.recycleUnchecked();
@@ -334,6 +332,7 @@ public final class MessageStack {
            if (!m.isRemoved()) {
                return m;
            }
            if (m.heapIndex >= 0) {
                if (async) {
                    mAsyncHeap.removeMessage(m);
                } else {
@@ -341,6 +340,7 @@ public final class MessageStack {
                }
            }
        }
    }

    /**
     * Remove the input Message.