Lines Matching refs:msg
151 status_t InputChannel::sendMessage(const InputMessage* msg) { in sendMessage() argument
152 size_t msgLength = msg->size(); in sendMessage()
155 nWrite = ::send(mFd, msg, msgLength, MSG_DONTWAIT | MSG_NOSIGNAL); in sendMessage()
162 msg->header.type, error); in sendMessage()
176 mName.string(), msg->header.type); in sendMessage()
182 ALOGD("channel '%s' ~ sent message of type %d", mName.string(), msg->header.type); in sendMessage()
187 status_t InputChannel::receiveMessage(InputMessage* msg) { in receiveMessage() argument
190 nRead = ::recv(mFd, msg, sizeof(InputMessage), MSG_DONTWAIT); in receiveMessage()
214 if (!msg->isValid(nRead)) { in receiveMessage()
222 ALOGD("channel '%s' ~ received message of type %d", mName.string(), msg->header.type); in receiveMessage()
268 InputMessage msg; in publishKeyEvent() local
269 msg.header.type = InputMessage::TYPE_KEY; in publishKeyEvent()
270 msg.body.key.seq = seq; in publishKeyEvent()
271 msg.body.key.deviceId = deviceId; in publishKeyEvent()
272 msg.body.key.source = source; in publishKeyEvent()
273 msg.body.key.action = action; in publishKeyEvent()
274 msg.body.key.flags = flags; in publishKeyEvent()
275 msg.body.key.keyCode = keyCode; in publishKeyEvent()
276 msg.body.key.scanCode = scanCode; in publishKeyEvent()
277 msg.body.key.metaState = metaState; in publishKeyEvent()
278 msg.body.key.repeatCount = repeatCount; in publishKeyEvent()
279 msg.body.key.downTime = downTime; in publishKeyEvent()
280 msg.body.key.eventTime = eventTime; in publishKeyEvent()
281 return mChannel->sendMessage(&msg); in publishKeyEvent()
325 InputMessage msg; in publishMotionEvent() local
326 msg.header.type = InputMessage::TYPE_MOTION; in publishMotionEvent()
327 msg.body.motion.seq = seq; in publishMotionEvent()
328 msg.body.motion.deviceId = deviceId; in publishMotionEvent()
329 msg.body.motion.source = source; in publishMotionEvent()
330 msg.body.motion.action = action; in publishMotionEvent()
331 msg.body.motion.actionButton = actionButton; in publishMotionEvent()
332 msg.body.motion.flags = flags; in publishMotionEvent()
333 msg.body.motion.edgeFlags = edgeFlags; in publishMotionEvent()
334 msg.body.motion.metaState = metaState; in publishMotionEvent()
335 msg.body.motion.buttonState = buttonState; in publishMotionEvent()
336 msg.body.motion.xOffset = xOffset; in publishMotionEvent()
337 msg.body.motion.yOffset = yOffset; in publishMotionEvent()
338 msg.body.motion.xPrecision = xPrecision; in publishMotionEvent()
339 msg.body.motion.yPrecision = yPrecision; in publishMotionEvent()
340 msg.body.motion.downTime = downTime; in publishMotionEvent()
341 msg.body.motion.eventTime = eventTime; in publishMotionEvent()
342 msg.body.motion.pointerCount = pointerCount; in publishMotionEvent()
344 msg.body.motion.pointers[i].properties.copyFrom(pointerProperties[i]); in publishMotionEvent()
345 msg.body.motion.pointers[i].coords.copyFrom(pointerCoords[i]); in publishMotionEvent()
347 return mChannel->sendMessage(&msg); in publishMotionEvent()
356 InputMessage msg; in receiveFinishedSignal() local
357 status_t result = mChannel->receiveMessage(&msg); in receiveFinishedSignal()
363 if (msg.header.type != InputMessage::TYPE_FINISHED) { in receiveFinishedSignal()
365 mChannel->getName().string(), msg.header.type); in receiveFinishedSignal()
368 *outSeq = msg.body.finished.seq; in receiveFinishedSignal()
369 *outHandled = msg.body.finished.handled; in receiveFinishedSignal()
561 InputMessage& msg = batch.samples.editItemAt(i); in consumeSamples() local
562 updateTouchState(&msg); in consumeSamples()
565 seqChain.seq = msg.body.motion.seq; in consumeSamples()
568 addSample(motionEvent, &msg); in consumeSamples()
570 initializeMotionEvent(motionEvent, &msg); in consumeSamples()
572 chain = msg.body.motion.seq; in consumeSamples()
581 void InputConsumer::updateTouchState(InputMessage* msg) { in updateTouchState() argument
583 !(msg->body.motion.source & AINPUT_SOURCE_CLASS_POINTER)) { in updateTouchState()
587 int32_t deviceId = msg->body.motion.deviceId; in updateTouchState()
588 int32_t source = msg->body.motion.source; in updateTouchState()
589 nsecs_t eventTime = msg->body.motion.eventTime; in updateTouchState()
594 switch (msg->body.motion.action & AMOTION_EVENT_ACTION_MASK) { in updateTouchState()
603 touchState.addHistory(msg); in updateTouchState()
611 touchState.addHistory(msg); in updateTouchState()
613 rewriteMessage(touchState, msg); in updateTouchState()
625 touchState.lastResample.idBits.clearBit(msg->body.motion.getActionId()); in updateTouchState()
626 rewriteMessage(touchState, msg); in updateTouchState()
635 rewriteMessage(touchState, msg); in updateTouchState()
636 touchState.lastResample.idBits.clearBit(msg->body.motion.getActionId()); in updateTouchState()
645 rewriteMessage(touchState, msg); in updateTouchState()
655 rewriteMessage(touchState, msg); in updateTouchState()
663 void InputConsumer::rewriteMessage(const TouchState& state, InputMessage* msg) { in rewriteMessage() argument
664 for (uint32_t i = 0; i < msg->body.motion.pointerCount; i++) { in rewriteMessage()
665 uint32_t id = msg->body.motion.pointers[i].properties.id; in rewriteMessage()
667 PointerCoords& msgCoords = msg->body.motion.pointers[i].coords; in rewriteMessage()
863 InputMessage msg; in sendUnchainedFinishedSignal() local
864 msg.header.type = InputMessage::TYPE_FINISHED; in sendUnchainedFinishedSignal()
865 msg.body.finished.seq = seq; in sendUnchainedFinishedSignal()
866 msg.body.finished.handled = handled; in sendUnchainedFinishedSignal()
867 return mChannel->sendMessage(&msg); in sendUnchainedFinishedSignal()
899 void InputConsumer::initializeKeyEvent(KeyEvent* event, const InputMessage* msg) { in initializeKeyEvent() argument
901 msg->body.key.deviceId, in initializeKeyEvent()
902 msg->body.key.source, in initializeKeyEvent()
903 msg->body.key.action, in initializeKeyEvent()
904 msg->body.key.flags, in initializeKeyEvent()
905 msg->body.key.keyCode, in initializeKeyEvent()
906 msg->body.key.scanCode, in initializeKeyEvent()
907 msg->body.key.metaState, in initializeKeyEvent()
908 msg->body.key.repeatCount, in initializeKeyEvent()
909 msg->body.key.downTime, in initializeKeyEvent()
910 msg->body.key.eventTime); in initializeKeyEvent()
913 void InputConsumer::initializeMotionEvent(MotionEvent* event, const InputMessage* msg) { in initializeMotionEvent() argument
914 uint32_t pointerCount = msg->body.motion.pointerCount; in initializeMotionEvent()
918 pointerProperties[i].copyFrom(msg->body.motion.pointers[i].properties); in initializeMotionEvent()
919 pointerCoords[i].copyFrom(msg->body.motion.pointers[i].coords); in initializeMotionEvent()
923 msg->body.motion.deviceId, in initializeMotionEvent()
924 msg->body.motion.source, in initializeMotionEvent()
925 msg->body.motion.action, in initializeMotionEvent()
926 msg->body.motion.actionButton, in initializeMotionEvent()
927 msg->body.motion.flags, in initializeMotionEvent()
928 msg->body.motion.edgeFlags, in initializeMotionEvent()
929 msg->body.motion.metaState, in initializeMotionEvent()
930 msg->body.motion.buttonState, in initializeMotionEvent()
931 msg->body.motion.xOffset, in initializeMotionEvent()
932 msg->body.motion.yOffset, in initializeMotionEvent()
933 msg->body.motion.xPrecision, in initializeMotionEvent()
934 msg->body.motion.yPrecision, in initializeMotionEvent()
935 msg->body.motion.downTime, in initializeMotionEvent()
936 msg->body.motion.eventTime, in initializeMotionEvent()
942 void InputConsumer::addSample(MotionEvent* event, const InputMessage* msg) { in addSample() argument
943 uint32_t pointerCount = msg->body.motion.pointerCount; in addSample()
946 pointerCoords[i].copyFrom(msg->body.motion.pointers[i].coords); in addSample()
949 event->setMetaState(event->getMetaState() | msg->body.motion.metaState); in addSample()
950 event->addSample(msg->body.motion.eventTime, pointerCoords); in addSample()
953 bool InputConsumer::canAddSample(const Batch& batch, const InputMessage *msg) { in canAddSample() argument
955 uint32_t pointerCount = msg->body.motion.pointerCount; in canAddSample()
957 || head.body.motion.action != msg->body.motion.action) { in canAddSample()
962 != msg->body.motion.pointers[i].properties) { in canAddSample()