Fix UiAutomation to correctly wait for idleness
Currently, everytime onAccessibilityEvent is called, "lastEventTime" is
updated with the event timestamp. However, accessibility framework
doesn't always sends events by the order of the timestamp, so it's
possible that the timestamp is updated with an older event's timestamp.
This fixes the issue by updating the variable with maximum of the
current value and the event time.
Test: CtsCompanionDeviceManagerUiAutomationTestCases (fixes flakiness)
Test: UiAutomationTest
Bug: 262184630
Bug: 268464095
Change-Id: If3306c6a6624a8b76a17d2c7b745143e5f9c1ed3
1 file changed