From af48e4d9b2d4083b47481c945c02d3ce051db92f Mon Sep 17 00:00:00 2001 From: dingxiaobo Date: Wed, 14 Oct 2020 14:22:35 +0800 Subject: [PATCH] Avoid MotionEvent no finish raise unnecessary ANR In Monkey test. if Trackball MotionEvent and FocusEvent come together. motionEvent will be put to batches , Didn't call onBatchedInputEventPending due to FocusEvent Return early. So the motionEvent would't be handled and finish, And the related inputChannel would't receive inputevents due to FocusWindow change. Finally raise unnecessary ANR. Change-Id: I0d48b28e446dc8bccd98932b4e07200276a38aa8 --- core/jni/android_view_InputEventReceiver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/jni/android_view_InputEventReceiver.cpp b/core/jni/android_view_InputEventReceiver.cpp index cc94d6ff5d673..4220c1d87087f 100644 --- a/core/jni/android_view_InputEventReceiver.cpp +++ b/core/jni/android_view_InputEventReceiver.cpp @@ -321,7 +321,7 @@ status_t NativeInputEventReceiver::consumeEvents(JNIEnv* env, jboolean(focusEvent->getHasFocus()), jboolean(focusEvent->getInTouchMode())); finishInputEvent(seq, true /* handled */); - return OK; + continue; } default: