Wait for dispatcher idle before asserting policy callbacks
Before this CL, the policy state was asserted too early. The dispatcher
might not have finished processing the commands yet.
To fix this, force the tests to wait until dispatcher is idle by
providing a dispatcher reference to the assertion function.
Bug: 282837934
Test: atest inputflinger_tests
Change-Id: Ie427071f774d2bfb4b9ebfef94c7971656a69509
diff --git a/services/inputflinger/dispatcher/include/InputDispatcherInterface.h b/services/inputflinger/dispatcher/include/InputDispatcherInterface.h
index c752ddd..627f122 100644
--- a/services/inputflinger/dispatcher/include/InputDispatcherInterface.h
+++ b/services/inputflinger/dispatcher/include/InputDispatcherInterface.h
@@ -50,7 +50,7 @@
* Return true if the dispatcher is idle.
* Return false if the timeout waiting for the dispatcher to become idle has expired.
*/
- virtual bool waitForIdle() = 0;
+ virtual bool waitForIdle() const = 0;
/* Make the dispatcher start processing events.
*