Only wait for animations to complete when injecting a DOWN event.

When running quick step launcher tests, the tests attempt to inject
input to start the recents animation. However, because the launcher is
animating, the inject input will wait until the animation is complete.
This causes very slow input injection when attempting to go to recents
with quick step.

Since most cases will inject DOWN before any other event, it's mostly
safe to only wait for animations to complete before the first injection.
This is because the windows will most likely be correctly set up by then
and all other injections can proceed normally.

The code makes an exception for events that are from SOURCE_MOUSE since
we do want to wait for an animation to complete when dragging around a
mouse pointer since focus change could affect behavior.

Fixes: 128333900
Bug: 128446223
Test: TaplTestsQuickstep#testBackground,testSwitchToOverview
Change-Id: I153130282a7cc824d260541b98b57c04e5f90f4f
1 file changed