Merge "Fix UiAutomation to correctly wait for idleness"

This commit is contained in:
TreeHugger Robot
2023-02-14 23:56:53 +00:00
committed by Android (Google) Code Review

View File

@@ -1667,7 +1667,9 @@ public final class UiAutomation {
if (isGenerationChangedLocked()) {
return;
}
mLastEventTimeMillis = event.getEventTime();
// It is not guaranteed that the accessibility framework sends events by the
// order of event timestamp.
mLastEventTimeMillis = Math.max(mLastEventTimeMillis, event.getEventTime());
if (mWaitingForEventDelivery) {
mEventQueue.add(AccessibilityEvent.obtain(event));
}