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

Commit 902185b5 authored by Roman Birg's avatar Roman Birg Committed by Gerrit Code Review
Browse files

Revert "Barrier only messages shouldn't prevent the idle handlers from running"

Ticket: CYNGNOS-760

This reverts commit b1d1b1a4.

Change-Id: I9ddf6bffd8555249f448ff32f78611f7dbabb3f0
parent 4c857120
Loading
Loading
Loading
Loading
+2 −21
Original line number Diff line number Diff line
@@ -145,8 +145,6 @@ public final class MessageQueue {
            synchronized (this) {
                // Try to retrieve the next message.  Return if found.
                final long now = SystemClock.uptimeMillis();
                boolean validMsgs = (mMessages != null);

                Message prevMsg = null;
                Message msg = mMessages;
                if (msg != null && msg.target == null) {
@@ -173,23 +171,6 @@ public final class MessageQueue {
                        return msg;
                    }
                } else {
                    /* Check if all of the messages in the list are barrier
                     * messages. If so we still consider the queue idle, cause
                     * barrier messages are not real messages. */
                    Message msgBarr = mMessages;
                    boolean found = false;
                    while (msgBarr != null)
                    {
                        /* Found one non barrier message? Stop progressing. */
                        if (msgBarr.target != null)
                        {
                            found = true;
                            break;
                        }
                        msgBarr = msgBarr.next;
                    }
                    if (!found)
                        validMsgs = false;
                    // No more messages.
                    nextPollTimeoutMillis = -1;
                }
@@ -202,9 +183,9 @@ public final class MessageQueue {

                // If first time idle, then get the number of idlers to run.
                // Idle handles only run if the queue is empty or if the first message
                // in the queue is due to be handled in the future.
                // in the queue (possibly a barrier) is due to be handled in the future.
                if (pendingIdleHandlerCount < 0
                        && (!validMsgs || now < mMessages.when)) {
                        && (mMessages == null || now < mMessages.when)) {
                    pendingIdleHandlerCount = mIdleHandlers.size();
                }
                if (pendingIdleHandlerCount <= 0) {