Lines Matching defs:entry

301             // Inbound queue has at least one entry.
400 bool InputDispatcher::enqueueInboundEventLocked(EventEntry* entry) {
402 mInboundQueue.enqueueAtTail(entry);
405 switch (entry->type) {
410 KeyEntry* keyEntry = static_cast<KeyEntry*>(entry);
433 MotionEntry* motionEntry = static_cast<MotionEntry*>(entry);
460 void InputDispatcher::addRecentEventLocked(EventEntry* entry) {
461 entry->refCount += 1;
462 mRecentQueue.enqueueAtTail(entry);
499 void InputDispatcher::dropInboundEventLocked(EventEntry* entry, DropReason dropReason) {
531 switch (entry->type) {
538 MotionEntry* motionEntry = static_cast<MotionEntry*>(entry);
580 bool InputDispatcher::isStaleEventLocked(nsecs_t currentTime, EventEntry* entry) {
581 return currentTime - entry->eventTime >= STALE_EVENT_TIMEOUT;
613 EventEntry* entry = mInboundQueue.dequeueAtHead();
614 releaseInboundEventLocked(entry);
627 void InputDispatcher::releaseInboundEventLocked(EventEntry* entry) {
628 InjectionState* injectionState = entry->injectionState;
633 setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED);
635 if (entry == mNextUnblockedEvent) {
638 addRecentEventLocked(entry);
639 entry->release();
650 KeyEntry* entry = mKeyRepeatState.lastKeyEntry;
652 // Reuse the repeated key entry if it is otherwise unreferenced.
653 uint32_t policyFlags = (entry->policyFlags & POLICY_FLAG_RAW_MASK)
655 if (entry->refCount == 1) {
656 entry->recycle();
657 entry->eventTime = currentTime;
658 entry->policyFlags = policyFlags;
659 entry->repeatCount += 1;
662 entry->deviceId, entry->source, policyFlags,
663 entry->action, entry->flags, entry->keyCode, entry->scanCode,
664 entry->metaState, entry->repeatCount + 1, entry->downTime);
667 entry->release();
669 entry = newEntry;
671 entry->syntheticRepeat = true;
675 entry->refCount += 1;
678 return entry;
682 nsecs_t currentTime, ConfigurationChangedEntry* entry) {
684 ALOGD("dispatchConfigurationChanged - eventTime=%lld", entry->eventTime);
693 commandEntry->eventTime = entry->eventTime;
698 nsecs_t currentTime, DeviceResetEntry* entry) {
700 ALOGD("dispatchDeviceReset - eventTime=%lld, deviceId=%d", entry->eventTime, entry->deviceId);
705 options.deviceId = entry->deviceId;
710 bool InputDispatcher::dispatchKeyLocked(nsecs_t currentTime, KeyEntry* entry,
713 if (! entry->dispatchInProgress) {
714 if (entry->repeatCount == 0
715 && entry->action == AKEY_EVENT_ACTION_DOWN
716 && (entry->policyFlags & POLICY_FLAG_TRUSTED)
717 && (!(entry->policyFlags & POLICY_FLAG_DISABLE_KEY_REPEAT))) {
719 && mKeyRepeatState.lastKeyEntry->keyCode == entry->keyCode) {
724 entry->repeatCount = mKeyRepeatState.lastKeyEntry->repeatCount + 1;
730 mKeyRepeatState.nextRepeatTime = entry->eventTime + mConfig.keyRepeatTimeout;
732 mKeyRepeatState.lastKeyEntry = entry;
733 entry->refCount += 1;
734 } else if (! entry->syntheticRepeat) {
738 if (entry->repeatCount == 1) {
739 entry->flags |= AKEY_EVENT_FLAG_LONG_PRESS;
741 entry->flags &= ~AKEY_EVENT_FLAG_LONG_PRESS;
744 entry->dispatchInProgress = true;
746 logOutboundKeyDetailsLocked("dispatchKey - ", entry);
750 if (entry->interceptKeyResult == KeyEntry::INTERCEPT_KEY_RESULT_TRY_AGAIN_LATER) {
751 if (currentTime < entry->interceptKeyWakeupTime) {
752 if (entry->interceptKeyWakeupTime < *nextWakeupTime) {
753 *nextWakeupTime = entry->interceptKeyWakeupTime;
757 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_UNKNOWN;
758 entry->interceptKeyWakeupTime = 0;
762 if (entry->interceptKeyResult == KeyEntry::INTERCEPT_KEY_RESULT_UNKNOWN) {
763 if (entry->policyFlags & POLICY_FLAG_PASS_TO_USER) {
769 commandEntry->keyEntry = entry;
770 entry->refCount += 1;
773 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_CONTINUE;
775 } else if (entry->interceptKeyResult == KeyEntry::INTERCEPT_KEY_RESULT_SKIP) {
783 setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY
791 entry, inputTargets, nextWakeupTime);
796 setInjectionResultLocked(entry, injectionResult);
804 dispatchEventLocked(currentTime, entry, inputTargets);
808 void InputDispatcher::logOutboundKeyDetailsLocked(const char* prefix, const KeyEntry* entry) {
814 entry->eventTime, entry->deviceId, entry->source, entry->policyFlags,
815 entry->action, entry->flags, entry->keyCode, entry->scanCode, entry->metaState,
816 entry->repeatCount, entry->downTime);
821 nsecs_t currentTime, MotionEntry* entry, DropReason* dropReason, nsecs_t* nextWakeupTime) {
823 if (! entry->dispatchInProgress) {
824 entry->dispatchInProgress = true;
826 logOutboundMotionDetailsLocked("dispatchMotion - ", entry);
831 setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY
836 bool isPointerEvent = entry->source & AINPUT_SOURCE_CLASS_POINTER;
846 entry, inputTargets, nextWakeupTime, &conflictingPointerActions);
850 entry, inputTargets, nextWakeupTime);
856 setInjectionResultLocked(entry, injectionResult);
862 if (isMainDisplay(entry->displayId)) {
872 dispatchEventLocked(currentTime, entry, inputTargets);
877 void InputDispatcher::logOutboundMotionDetailsLocked(const char* prefix, const MotionEntry* entry) {
884 entry->eventTime, entry->deviceId, entry->source, entry->policyFlags,
885 entry->action, entry->flags,
886 entry->metaState, entry->buttonState,
887 entry->edgeFlags, entry->xPrecision, entry->yPrecision,
888 entry->downTime);
890 for (uint32_t i = 0; i < entry->pointerCount; i++) {
895 i, entry->pointerProperties[i].id,
896 entry->pointerProperties[i].toolType,
897 entry->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_X),
898 entry->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_Y),
899 entry->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_PRESSURE),
900 entry->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_SIZE),
901 entry->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MAJOR),
902 entry->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MINOR),
903 entry->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOOL_MAJOR),
904 entry->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_TOOL_MINOR),
905 entry->pointerCoords[i].getAxisValue(AMOTION_EVENT_AXIS_ORIENTATION));
938 const EventEntry* entry,
991 entry->eventTime, mInputTargetWaitStartTime, reason);
1055 const EventEntry* entry, Vector<InputTarget>& inputTargets, nsecs_t* nextWakeupTime) {
1062 injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
1076 if (! checkInjectionPermission(mFocusedWindowHandle, entry->injectionState)) {
1083 injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
1090 if (!isWindowReadyForMoreInputLocked(currentTime, mFocusedWindowHandle, entry)) {
1091 injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
1108 updateDispatchStatisticsLocked(currentTime, entry,
1119 const MotionEntry* entry, Vector<InputTarget>& inputTargets, nsecs_t* nextWakeupTime,
1155 int32_t displayId = entry->displayId;
1156 int32_t action = entry->action;
1166 && (mTouchState.deviceId != entry->deviceId
1167 || mTouchState.source != entry->source
1190 mTempTouchState.deviceId = entry->deviceId;
1191 mTempTouchState.source = entry->source;
1202 int32_t x = int32_t(entry->pointerCoords[pointerIndex].
1204 int32_t y = int32_t(entry->pointerCoords[pointerIndex].
1257 injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
1305 uint32_t pointerId = entry->pointerProperties[pointerIndex].id;
1324 && entry->pointerCount == 1
1326 int32_t x = int32_t(entry->pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_X));
1327 int32_t y = int32_t(entry->pointerCoords[0].getAxisValue(AMOTION_EVENT_AXIS_Y));
1360 pointerIds.markBit(entry->pointerProperties[0].id);
1398 entry->injectionState)) {
1441 injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
1448 if (!isWindowReadyForMoreInputLocked(currentTime, touchedWindow.windowHandle, entry)) {
1449 injectionResult = handleTargetsNotReadyLocked(currentTime, entry,
1499 if (checkInjectionPermission(NULL, entry->injectionState)) {
1527 mTouchState.deviceId = entry->deviceId;
1528 mTouchState.source = entry->source;
1548 uint32_t pointerId = entry->pointerProperties[pointerIndex].id;
1584 updateDispatchStatisticsLocked(currentTime, entry,
1851 // Enqueue a new dispatch entry onto the outbound queue for this connection.
1923 // Enqueue the dispatch entry.
2646 for (EventEntry* entry = firstInjectedEntry; entry != NULL; ) {
2647 EventEntry* nextEntry = entry->next;
2648 needWake |= enqueueInboundEventLocked(entry);
2649 entry = nextEntry;
2723 void InputDispatcher::setInjectionResultLocked(EventEntry* entry, int32_t injectionResult) {
2724 InjectionState* injectionState = entry->injectionState;
2733 && !(entry->policyFlags & POLICY_FLAG_FILTERED)) {
2756 void InputDispatcher::incrementPendingForegroundDispatchesLocked(EventEntry* entry) {
2757 InjectionState* injectionState = entry->injectionState;
2763 void InputDispatcher::decrementPendingForegroundDispatchesLocked(EventEntry* entry) {
2764 InjectionState* injectionState = entry->injectionState;
3166 for (EventEntry* entry = mRecentQueue.head; entry; entry = entry->next) {
3168 entry->appendDescription(dump);
3170 (currentTime - entry->eventTime) * 0.000001f);
3190 for (EventEntry* entry = mInboundQueue.head; entry; entry = entry->next) {
3192 entry->appendDescription(dump);
3194 (currentTime - entry->eventTime) * 0.000001f);
3213 for (DispatchEntry* entry = connection->outboundQueue.head; entry;
3214 entry = entry->next) {
3216 entry->eventEntry->appendDescription(dump);
3218 entry->targetFlags, entry->resolvedAction,
3219 (currentTime - entry->eventEntry->eventTime) * 0.000001f);
3228 for (DispatchEntry* entry = connection->waitQueue.head; entry;
3229 entry = entry->next) {
3231 entry->eventEntry->appendDescription(dump);
3234 entry->targetFlags, entry->resolvedAction,
3235 (currentTime - entry->eventEntry->eventTime) * 0.000001f,
3236 (currentTime - entry->deliveryTime) * 0.000001f);
3452 KeyEntry* entry = commandEntry->keyEntry;
3455 initializeKeyEvent(&event, entry);
3460 &event, entry->policyFlags);
3465 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_SKIP;
3467 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_CONTINUE;
3469 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_TRY_AGAIN_LATER;
3470 entry->interceptKeyWakeupTime = now() + delay;
3472 entry->release();
3712 void InputDispatcher::initializeKeyEvent(KeyEvent* event, const KeyEntry* entry) {
3713 event->initialize(entry->deviceId, entry->source, entry->action, entry->flags,
3714 entry->keyCode, entry->scanCode, entry->metaState, entry->repeatCount,
3715 entry->downTime, entry->eventTime);
3718 void InputDispatcher::updateDispatchStatisticsLocked(nsecs_t currentTime, const EventEntry* entry,
3771 for (const T* entry = head; entry; entry = entry->next) {
3987 bool InputDispatcher::InputState::trackKey(const KeyEntry* entry,
3991 if (entry->flags & AKEY_EVENT_FLAG_FALLBACK) {
3993 if (mFallbackKeys.valueAt(i) == entry->keyCode) {
4000 ssize_t index = findKeyMemento(entry);
4017 entry->deviceId, entry->source, entry->keyCode, entry->scanCode);
4025 ssize_t index = findKeyMemento(entry);
4029 addKeyMemento(entry, flags);
4038 bool InputDispatcher::InputState::trackMotion(const MotionEntry* entry,
4044 ssize_t index = findMotionMemento(entry, false /*hovering*/);
4052 entry->deviceId, entry->source, actionMasked);
4058 ssize_t index = findMotionMemento(entry, false /*hovering*/);
4062 addMotionMemento(entry, flags, false /*hovering*/);
4069 ssize_t index = findMotionMemento(entry, false /*hovering*/);
4072 memento.setPointers(entry);
4076 && (entry->source & (AINPUT_SOURCE_CLASS_JOYSTICK
4084 entry->deviceId, entry->source, actionMasked);
4090 ssize_t index = findMotionMemento(entry, true /*hovering*/);
4097 entry->deviceId, entry->source);
4104 ssize_t index = findMotionMemento(entry, true /*hovering*/);
4108 addMotionMemento(entry, flags, true /*hovering*/);
4117 ssize_t InputDispatcher::InputState::findKeyMemento(const KeyEntry* entry) const {
4120 if (memento.deviceId == entry->deviceId
4121 && memento.source == entry->source
4122 && memento.keyCode == entry->keyCode
4123 && memento.scanCode == entry->scanCode) {
4130 ssize_t InputDispatcher::InputState::findMotionMemento(const MotionEntry* entry,
4134 if (memento.deviceId == entry->deviceId
4135 && memento.source == entry->source
4136 && memento.displayId == entry->displayId
4144 void InputDispatcher::InputState::addKeyMemento(const KeyEntry* entry, int32_t flags) {
4147 memento.deviceId = entry->deviceId;
4148 memento.source = entry->source;
4149 memento.keyCode = entry->keyCode;
4150 memento.scanCode = entry->scanCode;
4151 memento.metaState = entry->metaState;
4153 memento.downTime = entry->downTime;
4154 memento.policyFlags = entry->policyFlags;
4157 void InputDispatcher::InputState::addMotionMemento(const MotionEntry* entry,
4161 memento.deviceId = entry->deviceId;
4162 memento.source = entry->source;
4164 memento.xPrecision = entry->xPrecision;
4165 memento.yPrecision = entry->yPrecision;
4166 memento.downTime = entry->downTime;
4167 memento.displayId = entry->displayId;
4168 memento.setPointers(entry);
4170 memento.policyFlags = entry->policyFlags;
4173 void InputDispatcher::InputState::MotionMemento::setPointers(const MotionEntry* entry) {
4174 pointerCount = entry->pointerCount;
4175 for (uint32_t i = 0; i < entry->pointerCount; i++) {
4176 pointerProperties[i].copyFrom(entry->pointerProperties[i]);
4177 pointerCoords[i].copyFrom(entry->pointerCoords[i]);
4332 for (DispatchEntry* entry = waitQueue.head; entry != NULL; entry = entry->next) {
4333 if (entry->seq == seq) {
4334 return entry;