Lines Matching refs:msg

124 void InputMessage::getSanitizedCopy(InputMessage* msg) const {  in getSanitizedCopy()
125 memset(msg, 0, sizeof(*msg)); in getSanitizedCopy()
128 msg->header.type = header.type; in getSanitizedCopy()
134 msg->body.key.seq = body.key.seq; in getSanitizedCopy()
136 msg->body.key.eventTime = body.key.eventTime; in getSanitizedCopy()
138 msg->body.key.deviceId = body.key.deviceId; in getSanitizedCopy()
140 msg->body.key.source = body.key.source; in getSanitizedCopy()
142 msg->body.key.displayId = body.key.displayId; in getSanitizedCopy()
144 msg->body.key.action = body.key.action; in getSanitizedCopy()
146 msg->body.key.flags = body.key.flags; in getSanitizedCopy()
148 msg->body.key.keyCode = body.key.keyCode; in getSanitizedCopy()
150 msg->body.key.scanCode = body.key.scanCode; in getSanitizedCopy()
152 msg->body.key.metaState = body.key.metaState; in getSanitizedCopy()
154 msg->body.key.repeatCount = body.key.repeatCount; in getSanitizedCopy()
156 msg->body.key.downTime = body.key.downTime; in getSanitizedCopy()
161 msg->body.motion.seq = body.motion.seq; in getSanitizedCopy()
163 msg->body.motion.eventTime = body.motion.eventTime; in getSanitizedCopy()
165 msg->body.motion.deviceId = body.motion.deviceId; in getSanitizedCopy()
167 msg->body.motion.source = body.motion.source; in getSanitizedCopy()
169 msg->body.motion.displayId = body.motion.displayId; in getSanitizedCopy()
171 msg->body.motion.action = body.motion.action; in getSanitizedCopy()
173 msg->body.motion.actionButton = body.motion.actionButton; in getSanitizedCopy()
175 msg->body.motion.flags = body.motion.flags; in getSanitizedCopy()
177 msg->body.motion.metaState = body.motion.metaState; in getSanitizedCopy()
179 msg->body.motion.buttonState = body.motion.buttonState; in getSanitizedCopy()
181 msg->body.motion.classification = body.motion.classification; in getSanitizedCopy()
183 msg->body.motion.edgeFlags = body.motion.edgeFlags; in getSanitizedCopy()
185 msg->body.motion.downTime = body.motion.downTime; in getSanitizedCopy()
187 msg->body.motion.xOffset = body.motion.xOffset; in getSanitizedCopy()
189 msg->body.motion.yOffset = body.motion.yOffset; in getSanitizedCopy()
191 msg->body.motion.xPrecision = body.motion.xPrecision; in getSanitizedCopy()
193 msg->body.motion.yPrecision = body.motion.yPrecision; in getSanitizedCopy()
195 msg->body.motion.pointerCount = body.motion.pointerCount; in getSanitizedCopy()
199 msg->body.motion.pointers[i].properties.id = body.motion.pointers[i].properties.id; in getSanitizedCopy()
200 msg->body.motion.pointers[i].properties.toolType = in getSanitizedCopy()
203 msg->body.motion.pointers[i].coords.bits = body.motion.pointers[i].coords.bits; in getSanitizedCopy()
205 memcpy(&msg->body.motion.pointers[i].coords.values[0], in getSanitizedCopy()
212 msg->body.finished.seq = body.finished.seq; in getSanitizedCopy()
213 msg->body.finished.handled = body.finished.handled; in getSanitizedCopy()
284 status_t InputChannel::sendMessage(const InputMessage* msg) { in sendMessage() argument
285 const size_t msgLength = msg->size(); in sendMessage()
287 msg->getSanitizedCopy(&cleanMsg); in sendMessage()
297 msg->header.type, error); in sendMessage()
311 mName.c_str(), msg->header.type); in sendMessage()
317 ALOGD("channel '%s' ~ sent message of type %d", mName.c_str(), msg->header.type); in sendMessage()
322 status_t InputChannel::receiveMessage(InputMessage* msg) { in receiveMessage() argument
325 nRead = ::recv(mFd, msg, sizeof(InputMessage), MSG_DONTWAIT); in receiveMessage()
349 if (!msg->isValid(nRead)) { in receiveMessage()
357 ALOGD("channel '%s' ~ received message of type %d", mName.c_str(), msg->header.type); in receiveMessage()
450 InputMessage msg; in publishKeyEvent() local
451 msg.header.type = InputMessage::TYPE_KEY; in publishKeyEvent()
452 msg.body.key.seq = seq; in publishKeyEvent()
453 msg.body.key.deviceId = deviceId; in publishKeyEvent()
454 msg.body.key.source = source; in publishKeyEvent()
455 msg.body.key.displayId = displayId; in publishKeyEvent()
456 msg.body.key.action = action; in publishKeyEvent()
457 msg.body.key.flags = flags; in publishKeyEvent()
458 msg.body.key.keyCode = keyCode; in publishKeyEvent()
459 msg.body.key.scanCode = scanCode; in publishKeyEvent()
460 msg.body.key.metaState = metaState; in publishKeyEvent()
461 msg.body.key.repeatCount = repeatCount; in publishKeyEvent()
462 msg.body.key.downTime = downTime; in publishKeyEvent()
463 msg.body.key.eventTime = eventTime; in publishKeyEvent()
464 return mChannel->sendMessage(&msg); in publishKeyEvent()
518 InputMessage msg; in publishMotionEvent() local
519 msg.header.type = InputMessage::TYPE_MOTION; in publishMotionEvent()
520 msg.body.motion.seq = seq; in publishMotionEvent()
521 msg.body.motion.deviceId = deviceId; in publishMotionEvent()
522 msg.body.motion.source = source; in publishMotionEvent()
523 msg.body.motion.displayId = displayId; in publishMotionEvent()
524 msg.body.motion.action = action; in publishMotionEvent()
525 msg.body.motion.actionButton = actionButton; in publishMotionEvent()
526 msg.body.motion.flags = flags; in publishMotionEvent()
527 msg.body.motion.edgeFlags = edgeFlags; in publishMotionEvent()
528 msg.body.motion.metaState = metaState; in publishMotionEvent()
529 msg.body.motion.buttonState = buttonState; in publishMotionEvent()
530 msg.body.motion.classification = classification; in publishMotionEvent()
531 msg.body.motion.xOffset = xOffset; in publishMotionEvent()
532 msg.body.motion.yOffset = yOffset; in publishMotionEvent()
533 msg.body.motion.xPrecision = xPrecision; in publishMotionEvent()
534 msg.body.motion.yPrecision = yPrecision; in publishMotionEvent()
535 msg.body.motion.downTime = downTime; in publishMotionEvent()
536 msg.body.motion.eventTime = eventTime; in publishMotionEvent()
537 msg.body.motion.pointerCount = pointerCount; in publishMotionEvent()
539 msg.body.motion.pointers[i].properties.copyFrom(pointerProperties[i]); in publishMotionEvent()
540 msg.body.motion.pointers[i].coords.copyFrom(pointerCoords[i]); in publishMotionEvent()
542 return mChannel->sendMessage(&msg); in publishMotionEvent()
551 InputMessage msg; in receiveFinishedSignal() local
552 status_t result = mChannel->receiveMessage(&msg); in receiveFinishedSignal()
558 if (msg.header.type != InputMessage::TYPE_FINISHED) { in receiveFinishedSignal()
560 mChannel->getName().c_str(), msg.header.type); in receiveFinishedSignal()
563 *outSeq = msg.body.finished.seq; in receiveFinishedSignal()
564 *outHandled = msg.body.finished.handled; in receiveFinishedSignal()
649 const InputMessage& msg = batch.samples.itemAt(i); in consume() local
650 sendFinishedSignal(msg.body.motion.seq, false); in consume()
755 InputMessage& msg = batch.samples.editItemAt(i); in consumeSamples() local
756 updateTouchState(msg); in consumeSamples()
759 seqChain.seq = msg.body.motion.seq; in consumeSamples()
762 addSample(motionEvent, &msg); in consumeSamples()
764 initializeMotionEvent(motionEvent, &msg); in consumeSamples()
766 chain = msg.body.motion.seq; in consumeSamples()
775 void InputConsumer::updateTouchState(InputMessage& msg) { in updateTouchState() argument
776 if (!mResampleTouch || !isPointerEvent(msg.body.motion.source)) { in updateTouchState()
780 int32_t deviceId = msg.body.motion.deviceId; in updateTouchState()
781 int32_t source = msg.body.motion.source; in updateTouchState()
786 switch (msg.body.motion.action & AMOTION_EVENT_ACTION_MASK) { in updateTouchState()
795 touchState.addHistory(msg); in updateTouchState()
803 touchState.addHistory(msg); in updateTouchState()
804 rewriteMessage(touchState, msg); in updateTouchState()
813 touchState.lastResample.idBits.clearBit(msg.body.motion.getActionId()); in updateTouchState()
814 rewriteMessage(touchState, msg); in updateTouchState()
823 rewriteMessage(touchState, msg); in updateTouchState()
824 touchState.lastResample.idBits.clearBit(msg.body.motion.getActionId()); in updateTouchState()
833 rewriteMessage(touchState, msg); in updateTouchState()
843 rewriteMessage(touchState, msg); in updateTouchState()
862 void InputConsumer::rewriteMessage(TouchState& state, InputMessage& msg) { in rewriteMessage() argument
863 nsecs_t eventTime = msg.body.motion.eventTime; in rewriteMessage()
864 for (uint32_t i = 0; i < msg.body.motion.pointerCount; i++) { in rewriteMessage()
865 uint32_t id = msg.body.motion.pointers[i].properties.id; in rewriteMessage()
869 PointerCoords& msgCoords = msg.body.motion.pointers[i].coords; in rewriteMessage()
1078 InputMessage msg; in sendUnchainedFinishedSignal() local
1079 msg.header.type = InputMessage::TYPE_FINISHED; in sendUnchainedFinishedSignal()
1080 msg.body.finished.seq = seq; in sendUnchainedFinishedSignal()
1081 msg.body.finished.handled = handled; in sendUnchainedFinishedSignal()
1082 return mChannel->sendMessage(&msg); in sendUnchainedFinishedSignal()
1114 void InputConsumer::initializeKeyEvent(KeyEvent* event, const InputMessage* msg) { in initializeKeyEvent() argument
1116 msg->body.key.deviceId, in initializeKeyEvent()
1117 msg->body.key.source, in initializeKeyEvent()
1118 msg->body.key.displayId, in initializeKeyEvent()
1119 msg->body.key.action, in initializeKeyEvent()
1120 msg->body.key.flags, in initializeKeyEvent()
1121 msg->body.key.keyCode, in initializeKeyEvent()
1122 msg->body.key.scanCode, in initializeKeyEvent()
1123 msg->body.key.metaState, in initializeKeyEvent()
1124 msg->body.key.repeatCount, in initializeKeyEvent()
1125 msg->body.key.downTime, in initializeKeyEvent()
1126 msg->body.key.eventTime); in initializeKeyEvent()
1129 void InputConsumer::initializeMotionEvent(MotionEvent* event, const InputMessage* msg) { in initializeMotionEvent() argument
1130 uint32_t pointerCount = msg->body.motion.pointerCount; in initializeMotionEvent()
1134 pointerProperties[i].copyFrom(msg->body.motion.pointers[i].properties); in initializeMotionEvent()
1135 pointerCoords[i].copyFrom(msg->body.motion.pointers[i].coords); in initializeMotionEvent()
1139 msg->body.motion.deviceId, in initializeMotionEvent()
1140 msg->body.motion.source, in initializeMotionEvent()
1141 msg->body.motion.displayId, in initializeMotionEvent()
1142 msg->body.motion.action, in initializeMotionEvent()
1143 msg->body.motion.actionButton, in initializeMotionEvent()
1144 msg->body.motion.flags, in initializeMotionEvent()
1145 msg->body.motion.edgeFlags, in initializeMotionEvent()
1146 msg->body.motion.metaState, in initializeMotionEvent()
1147 msg->body.motion.buttonState, in initializeMotionEvent()
1148 msg->body.motion.classification, in initializeMotionEvent()
1149 msg->body.motion.xOffset, in initializeMotionEvent()
1150 msg->body.motion.yOffset, in initializeMotionEvent()
1151 msg->body.motion.xPrecision, in initializeMotionEvent()
1152 msg->body.motion.yPrecision, in initializeMotionEvent()
1153 msg->body.motion.downTime, in initializeMotionEvent()
1154 msg->body.motion.eventTime, in initializeMotionEvent()
1160 void InputConsumer::addSample(MotionEvent* event, const InputMessage* msg) { in addSample() argument
1161 uint32_t pointerCount = msg->body.motion.pointerCount; in addSample()
1164 pointerCoords[i].copyFrom(msg->body.motion.pointers[i].coords); in addSample()
1167 event->setMetaState(event->getMetaState() | msg->body.motion.metaState); in addSample()
1168 event->addSample(msg->body.motion.eventTime, pointerCoords); in addSample()
1171 bool InputConsumer::canAddSample(const Batch& batch, const InputMessage *msg) { in canAddSample() argument
1173 uint32_t pointerCount = msg->body.motion.pointerCount; in canAddSample()
1175 || head.body.motion.action != msg->body.motion.action) { in canAddSample()
1180 != msg->body.motion.pointers[i].properties) { in canAddSample()