Skip to content

Commit b0b8df4

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "Improve responsiveness by always consuming batched events."
2 parents 15d5a96 + fa8b27c commit b0b8df4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

core/java/android/view/ViewRootImpl.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,9 +4056,13 @@ void doConsumeBatchedInput(boolean callback) {
40564056
mChoreographer.removeCallbacks(Choreographer.CALLBACK_INPUT,
40574057
mConsumedBatchedInputRunnable, null);
40584058
}
4059-
if (mInputEventReceiver != null) {
4060-
mInputEventReceiver.consumeBatchedInputEvents();
4061-
}
4059+
}
4060+
4061+
// Always consume batched input events even if not scheduled, because there
4062+
// might be new input there waiting for us that we have no noticed yet because
4063+
// the Looper has not had a chance to run again.
4064+
if (mInputEventReceiver != null) {
4065+
mInputEventReceiver.consumeBatchedInputEvents();
40624066
}
40634067
}
40644068

0 commit comments

Comments
 (0)