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

Commit 267fdb0b authored by Mark Fasheh's avatar Mark Fasheh
Browse files

ConcurrentMessageQueue fix idle calculation

We had some not-so-great logic to determine when to run
idle handlers. Really we just need to check if there are
messages to deliver.

This fixes our failures in ForwardDeleteTest,
FocusFinderTest and TouchDelegateTest.

I went ahead and made the same change to
SemiConcurrentMessageQueue as we have duplicated logic there.

Bug: 336880969
Flag: build.RELEASE_PACKAGE_MESSAGEQUEUE_IMPLEMENTATION
Test: atest CtsTextTestCases:android.text.method.cts.ForwardDeleteTest
Change-Id: I6ada22c3b6818ba48840350de09d4501bb1265c6
parent 342ed5f4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -754,7 +754,7 @@ public final class MessageQueue {
                // Idle handles only run if the queue is empty or if the first message
                // in the queue (possibly a barrier) is due to be handled in the future.
                if (pendingIdleHandlerCount < 0
                        && mNextPollTimeoutMillis != 0) {
                        && isIdle()) {
                    pendingIdleHandlerCount = mIdleHandlers.size();
                }
                if (pendingIdleHandlerCount <= 0) {
+1 −1
Original line number Diff line number Diff line
@@ -712,7 +712,7 @@ public final class MessageQueue {
                // Idle handles only run if the queue is empty or if the first message
                // in the queue (possibly a barrier) is due to be handled in the future.
                if (pendingIdleHandlerCount < 0
                        && mNextPollTimeoutMillis != 0) {
                        && isIdle()) {
                    pendingIdleHandlerCount = mIdleHandlers.size();
                }
                if (pendingIdleHandlerCount <= 0) {