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
2 files changed