Skip to content

Commit 225c2c8

Browse files
Treehugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "Move input event verify for publish to back of sendMessage" into main
2 parents bad8a9e + 72090cb commit 225c2c8

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

libs/input/InputTransport.cpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -583,15 +583,6 @@ status_t InputPublisher::publishMotionEvent(
583583
StringPrintf("publishMotionEvent(inputChannel=%s, action=%s)",
584584
mChannel->getName().c_str(),
585585
MotionEvent::actionToString(action).c_str()));
586-
if (verifyEvents()) {
587-
Result<void> result =
588-
mInputVerifier.processMovement(deviceId, source, action, pointerCount,
589-
pointerProperties, pointerCoords, flags);
590-
if (!result.ok()) {
591-
LOG(ERROR) << "Bad stream: " << result.error();
592-
return BAD_VALUE;
593-
}
594-
}
595586
if (debugTransportPublisher()) {
596587
std::string transformString;
597588
transform.dump(transformString, "transform", " ");
@@ -657,8 +648,18 @@ status_t InputPublisher::publishMotionEvent(
657648
msg.body.motion.pointers[i].properties = pointerProperties[i];
658649
msg.body.motion.pointers[i].coords = pointerCoords[i];
659650
}
651+
const status_t status = mChannel->sendMessage(&msg);
660652

661-
return mChannel->sendMessage(&msg);
653+
if (status == OK && verifyEvents()) {
654+
Result<void> result =
655+
mInputVerifier.processMovement(deviceId, source, action, pointerCount,
656+
pointerProperties, pointerCoords, flags);
657+
if (!result.ok()) {
658+
LOG(ERROR) << "Bad stream: " << result.error();
659+
return BAD_VALUE;
660+
}
661+
}
662+
return status;
662663
}
663664

664665
status_t InputPublisher::publishFocusEvent(uint32_t seq, int32_t eventId, bool hasFocus) {

0 commit comments

Comments
 (0)