Lines Matching refs:entry
291 EventEntry* entry = mInboundQueue.headSentinel.next; in dispatchOnceInnerLocked() local
298 if (entry->type == EventEntry::TYPE_MOTION in dispatchOnceInnerLocked()
301 && (entry->policyFlags & POLICY_FLAG_PASS_TO_USER) in dispatchOnceInnerLocked()
302 && !entry->isInjected()) { in dispatchOnceInnerLocked()
303 MotionEntry* motionEntry = static_cast<MotionEntry*>(entry); in dispatchOnceInnerLocked()
341 mThrottleState.lastEventTime = entry->eventTime < currentTime in dispatchOnceInnerLocked()
342 ? entry->eventTime : currentTime; in dispatchOnceInnerLocked()
347 mInboundQueue.dequeue(entry); in dispatchOnceInnerLocked()
348 mPendingEvent = entry; in dispatchOnceInnerLocked()
415 bool InputDispatcher::enqueueInboundEventLocked(EventEntry* entry) { in enqueueInboundEventLocked() argument
417 mInboundQueue.enqueueAtTail(entry); in enqueueInboundEventLocked()
419 switch (entry->type) { in enqueueInboundEventLocked()
421 KeyEntry* keyEntry = static_cast<KeyEntry*>(entry); in enqueueInboundEventLocked()
443 void InputDispatcher::dropInboundEventLocked(EventEntry* entry, DropReason dropReason) { in dropInboundEventLocked() argument
465 switch (entry->type) { in dropInboundEventLocked()
471 MotionEntry* motionEntry = static_cast<MotionEntry*>(entry); in dropInboundEventLocked()
536 EventEntry* entry = mInboundQueue.dequeueAtHead(); in drainInboundQueueLocked() local
537 releaseInboundEventLocked(entry); in drainInboundQueueLocked()
548 void InputDispatcher::releaseInboundEventLocked(EventEntry* entry) { in releaseInboundEventLocked() argument
549 InjectionState* injectionState = entry->injectionState; in releaseInboundEventLocked()
554 setInjectionResultLocked(entry, INPUT_EVENT_INJECTION_FAILED); in releaseInboundEventLocked()
556 mAllocator.releaseEventEntry(entry); in releaseInboundEventLocked()
568 KeyEntry* entry = mKeyRepeatState.lastKeyEntry; in synthesizeKeyRepeatLocked() local
571 uint32_t policyFlags = (entry->policyFlags & POLICY_FLAG_RAW_MASK) in synthesizeKeyRepeatLocked()
573 if (entry->refCount == 1) { in synthesizeKeyRepeatLocked()
574 mAllocator.recycleKeyEntry(entry); in synthesizeKeyRepeatLocked()
575 entry->eventTime = currentTime; in synthesizeKeyRepeatLocked()
576 entry->policyFlags = policyFlags; in synthesizeKeyRepeatLocked()
577 entry->repeatCount += 1; in synthesizeKeyRepeatLocked()
580 entry->deviceId, entry->source, policyFlags, in synthesizeKeyRepeatLocked()
581 entry->action, entry->flags, entry->keyCode, entry->scanCode, in synthesizeKeyRepeatLocked()
582 entry->metaState, entry->repeatCount + 1, entry->downTime); in synthesizeKeyRepeatLocked()
585 mAllocator.releaseKeyEntry(entry); in synthesizeKeyRepeatLocked()
587 entry = newEntry; in synthesizeKeyRepeatLocked()
589 entry->syntheticRepeat = true; in synthesizeKeyRepeatLocked()
593 entry->refCount += 1; in synthesizeKeyRepeatLocked()
596 return entry; in synthesizeKeyRepeatLocked()
600 nsecs_t currentTime, ConfigurationChangedEntry* entry) { in dispatchConfigurationChangedLocked() argument
602 LOGD("dispatchConfigurationChanged - eventTime=%lld", entry->eventTime); in dispatchConfigurationChangedLocked()
611 commandEntry->eventTime = entry->eventTime; in dispatchConfigurationChangedLocked()
616 nsecs_t currentTime, KeyEntry* entry, nsecs_t keyRepeatTimeout, in dispatchKeyLocked() argument
619 if (! entry->dispatchInProgress) { in dispatchKeyLocked()
620 if (entry->repeatCount == 0 in dispatchKeyLocked()
621 && entry->action == AKEY_EVENT_ACTION_DOWN in dispatchKeyLocked()
622 && (entry->policyFlags & POLICY_FLAG_TRUSTED) in dispatchKeyLocked()
623 && !entry->isInjected()) { in dispatchKeyLocked()
625 && mKeyRepeatState.lastKeyEntry->keyCode == entry->keyCode) { in dispatchKeyLocked()
630 entry->repeatCount = mKeyRepeatState.lastKeyEntry->repeatCount + 1; in dispatchKeyLocked()
636 mKeyRepeatState.nextRepeatTime = entry->eventTime + keyRepeatTimeout; in dispatchKeyLocked()
638 mKeyRepeatState.lastKeyEntry = entry; in dispatchKeyLocked()
639 entry->refCount += 1; in dispatchKeyLocked()
640 } else if (! entry->syntheticRepeat) { in dispatchKeyLocked()
644 if (entry->repeatCount == 1) { in dispatchKeyLocked()
645 entry->flags |= AKEY_EVENT_FLAG_LONG_PRESS; in dispatchKeyLocked()
647 entry->flags &= ~AKEY_EVENT_FLAG_LONG_PRESS; in dispatchKeyLocked()
650 entry->dispatchInProgress = true; in dispatchKeyLocked()
653 logOutboundKeyDetailsLocked("dispatchKey - ", entry); in dispatchKeyLocked()
657 if (entry->interceptKeyResult == KeyEntry::INTERCEPT_KEY_RESULT_UNKNOWN) { in dispatchKeyLocked()
658 if (entry->policyFlags & POLICY_FLAG_PASS_TO_USER) { in dispatchKeyLocked()
664 commandEntry->keyEntry = entry; in dispatchKeyLocked()
665 entry->refCount += 1; in dispatchKeyLocked()
668 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_CONTINUE; in dispatchKeyLocked()
670 } else if (entry->interceptKeyResult == KeyEntry::INTERCEPT_KEY_RESULT_SKIP) { in dispatchKeyLocked()
679 setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY in dispatchKeyLocked()
687 entry, nextWakeupTime); in dispatchKeyLocked()
692 setInjectionResultLocked(entry, injectionResult); in dispatchKeyLocked()
702 dispatchEventToCurrentInputTargetsLocked(currentTime, entry, false); in dispatchKeyLocked()
706 void InputDispatcher::logOutboundKeyDetailsLocked(const char* prefix, const KeyEntry* entry) { in logOutboundKeyDetailsLocked() argument
712 entry->eventTime, entry->deviceId, entry->source, entry->policyFlags, in logOutboundKeyDetailsLocked()
713 entry->action, entry->flags, entry->keyCode, entry->scanCode, entry->metaState, in logOutboundKeyDetailsLocked()
714 entry->repeatCount, entry->downTime); in logOutboundKeyDetailsLocked()
719 nsecs_t currentTime, MotionEntry* entry, DropReason* dropReason, nsecs_t* nextWakeupTime) { in dispatchMotionLocked() argument
721 if (! entry->dispatchInProgress) { in dispatchMotionLocked()
722 entry->dispatchInProgress = true; in dispatchMotionLocked()
725 logOutboundMotionDetailsLocked("dispatchMotion - ", entry); in dispatchMotionLocked()
731 setInjectionResultLocked(entry, *dropReason == DROP_REASON_POLICY in dispatchMotionLocked()
736 bool isPointerEvent = entry->source & AINPUT_SOURCE_CLASS_POINTER; in dispatchMotionLocked()
744 entry, nextWakeupTime); in dispatchMotionLocked()
748 entry, nextWakeupTime); in dispatchMotionLocked()
754 setInjectionResultLocked(entry, injectionResult); in dispatchMotionLocked()
764 dispatchEventToCurrentInputTargetsLocked(currentTime, entry, false); in dispatchMotionLocked()
769 void InputDispatcher::logOutboundMotionDetailsLocked(const char* prefix, const MotionEntry* entry) { in logOutboundMotionDetailsLocked() argument
775 entry->eventTime, entry->deviceId, entry->source, entry->policyFlags, in logOutboundMotionDetailsLocked()
776 entry->action, entry->flags, in logOutboundMotionDetailsLocked()
777 entry->metaState, entry->edgeFlags, entry->xPrecision, entry->yPrecision, in logOutboundMotionDetailsLocked()
778 entry->downTime); in logOutboundMotionDetailsLocked()
782 const MotionSample* sample = & entry->firstSample; in logOutboundMotionDetailsLocked()
786 for (uint32_t i = 0; i < entry->pointerCount; i++) { in logOutboundMotionDetailsLocked()
790 i, entry->pointerIds[i], in logOutboundMotionDetailsLocked()
800 if (entry->action == AMOTION_EVENT_ACTION_MOVE) { in logOutboundMotionDetailsLocked()
847 const EventEntry* entry, const InputApplication* application, const InputWindow* window, in handleTargetsNotReadyLocked() argument
880 onANRLocked(currentTime, application, window, entry->eventTime, mInputTargetWaitStartTime); in handleTargetsNotReadyLocked()
938 const EventEntry* entry, nsecs_t* nextWakeupTime) { in findFocusedWindowTargetsLocked() argument
952 injectionResult = handleTargetsNotReadyLocked(currentTime, entry, in findFocusedWindowTargetsLocked()
963 if (! checkInjectionPermission(mFocusedWindow, entry->injectionState)) { in findFocusedWindowTargetsLocked()
973 injectionResult = handleTargetsNotReadyLocked(currentTime, entry, in findFocusedWindowTargetsLocked()
983 injectionResult = handleTargetsNotReadyLocked(currentTime, entry, in findFocusedWindowTargetsLocked()
996 updateDispatchStatisticsLocked(currentTime, entry, in findFocusedWindowTargetsLocked()
1007 const MotionEntry* entry, nsecs_t* nextWakeupTime) { in findTouchedWindowTargetsLocked() argument
1044 int32_t action = entry->action; in findTouchedWindowTargetsLocked()
1063 int32_t x = int32_t(entry->firstSample.pointerCoords[pointerIndex].x); in findTouchedWindowTargetsLocked()
1064 int32_t y = int32_t(entry->firstSample.pointerCoords[pointerIndex].y); in findTouchedWindowTargetsLocked()
1111 injectionResult = handleTargetsNotReadyLocked(currentTime, entry, in findTouchedWindowTargetsLocked()
1137 injectionResult = handleTargetsNotReadyLocked(currentTime, entry, in findTouchedWindowTargetsLocked()
1159 uint32_t pointerId = entry->pointerIds[pointerIndex]; in findTouchedWindowTargetsLocked()
1182 if (! checkInjectionPermission(touchedWindow.window, entry->injectionState)) { in findTouchedWindowTargetsLocked()
1210 injectionResult = handleTargetsNotReadyLocked(currentTime, entry, in findTouchedWindowTargetsLocked()
1220 injectionResult = handleTargetsNotReadyLocked(currentTime, entry, in findTouchedWindowTargetsLocked()
1258 if (checkInjectionPermission(NULL, entry->injectionState)) { in findTouchedWindowTargetsLocked()
1282 uint32_t pointerId = entry->pointerIds[pointerIndex]; in findTouchedWindowTargetsLocked()
1311 updateDispatchStatisticsLocked(currentTime, entry, in findTouchedWindowTargetsLocked()
2157 for (EventEntry* entry = mInboundQueue.tailSentinel.prev; in notifyMotion() local
2158 entry != & mInboundQueue.headSentinel; entry = entry->prev) { in notifyMotion()
2159 if (entry->type != EventEntry::TYPE_MOTION) { in notifyMotion()
2164 MotionEntry* motionEntry = static_cast<MotionEntry*>(entry); in notifyMotion()
2436 void InputDispatcher::setInjectionResultLocked(EventEntry* entry, int32_t injectionResult) { in setInjectionResultLocked() argument
2437 InjectionState* injectionState = entry->injectionState; in setInjectionResultLocked()
2468 void InputDispatcher::incrementPendingForegroundDispatchesLocked(EventEntry* entry) { in incrementPendingForegroundDispatchesLocked() argument
2469 InjectionState* injectionState = entry->injectionState; in incrementPendingForegroundDispatchesLocked()
2475 void InputDispatcher::decrementPendingForegroundDispatchesLocked(EventEntry* entry) { in decrementPendingForegroundDispatchesLocked() argument
2476 InjectionState* injectionState = entry->injectionState; in decrementPendingForegroundDispatchesLocked()
2939 KeyEntry* entry = commandEntry->keyEntry; in doInterceptKeyBeforeDispatchingLockedInterruptible() local
2940 mReusableKeyEvent.initialize(entry->deviceId, entry->source, entry->action, entry->flags, in doInterceptKeyBeforeDispatchingLockedInterruptible()
2941 entry->keyCode, entry->scanCode, entry->metaState, entry->repeatCount, in doInterceptKeyBeforeDispatchingLockedInterruptible()
2942 entry->downTime, entry->eventTime); in doInterceptKeyBeforeDispatchingLockedInterruptible()
2947 & mReusableKeyEvent, entry->policyFlags); in doInterceptKeyBeforeDispatchingLockedInterruptible()
2951 entry->interceptKeyResult = consumed in doInterceptKeyBeforeDispatchingLockedInterruptible()
2954 mAllocator.releaseKeyEntry(entry); in doInterceptKeyBeforeDispatchingLockedInterruptible()
2965 void InputDispatcher::updateDispatchStatisticsLocked(nsecs_t currentTime, const EventEntry* entry, in updateDispatchStatisticsLocked() argument
2981 for (const T* entry = headSentinel.next; entry != & tailSentinel; entry = entry->next) { in count() local
3005 void InputDispatcher::Allocator::initializeEventEntry(EventEntry* entry, int32_t type, in initializeEventEntry() argument
3007 entry->type = type; in initializeEventEntry()
3008 entry->refCount = 1; in initializeEventEntry()
3009 entry->dispatchInProgress = false; in initializeEventEntry()
3010 entry->eventTime = eventTime; in initializeEventEntry()
3011 entry->policyFlags = policyFlags; in initializeEventEntry()
3012 entry->injectionState = NULL; in initializeEventEntry()
3015 void InputDispatcher::Allocator::releaseEventEntryInjectionState(EventEntry* entry) { in releaseEventEntryInjectionState() argument
3016 if (entry->injectionState) { in releaseEventEntryInjectionState()
3017 releaseInjectionState(entry->injectionState); in releaseEventEntryInjectionState()
3018 entry->injectionState = NULL; in releaseEventEntryInjectionState()
3024 ConfigurationChangedEntry* entry = mConfigurationChangeEntryPool.alloc(); in obtainConfigurationChangedEntry() local
3025 initializeEventEntry(entry, EventEntry::TYPE_CONFIGURATION_CHANGED, eventTime, 0); in obtainConfigurationChangedEntry()
3026 return entry; in obtainConfigurationChangedEntry()
3033 KeyEntry* entry = mKeyEntryPool.alloc(); in obtainKeyEntry() local
3034 initializeEventEntry(entry, EventEntry::TYPE_KEY, eventTime, policyFlags); in obtainKeyEntry()
3036 entry->deviceId = deviceId; in obtainKeyEntry()
3037 entry->source = source; in obtainKeyEntry()
3038 entry->action = action; in obtainKeyEntry()
3039 entry->flags = flags; in obtainKeyEntry()
3040 entry->keyCode = keyCode; in obtainKeyEntry()
3041 entry->scanCode = scanCode; in obtainKeyEntry()
3042 entry->metaState = metaState; in obtainKeyEntry()
3043 entry->repeatCount = repeatCount; in obtainKeyEntry()
3044 entry->downTime = downTime; in obtainKeyEntry()
3045 entry->syntheticRepeat = false; in obtainKeyEntry()
3046 entry->interceptKeyResult = KeyEntry::INTERCEPT_KEY_RESULT_UNKNOWN; in obtainKeyEntry()
3047 return entry; in obtainKeyEntry()
3055 MotionEntry* entry = mMotionEntryPool.alloc(); in obtainMotionEntry() local
3056 initializeEventEntry(entry, EventEntry::TYPE_MOTION, eventTime, policyFlags); in obtainMotionEntry()
3058 entry->eventTime = eventTime; in obtainMotionEntry()
3059 entry->deviceId = deviceId; in obtainMotionEntry()
3060 entry->source = source; in obtainMotionEntry()
3061 entry->action = action; in obtainMotionEntry()
3062 entry->flags = flags; in obtainMotionEntry()
3063 entry->metaState = metaState; in obtainMotionEntry()
3064 entry->edgeFlags = edgeFlags; in obtainMotionEntry()
3065 entry->xPrecision = xPrecision; in obtainMotionEntry()
3066 entry->yPrecision = yPrecision; in obtainMotionEntry()
3067 entry->downTime = downTime; in obtainMotionEntry()
3068 entry->pointerCount = pointerCount; in obtainMotionEntry()
3069 entry->firstSample.eventTime = eventTime; in obtainMotionEntry()
3070 entry->firstSample.next = NULL; in obtainMotionEntry()
3071 entry->lastSample = & entry->firstSample; in obtainMotionEntry()
3073 entry->pointerIds[i] = pointerIds[i]; in obtainMotionEntry()
3074 entry->firstSample.pointerCoords[i] = pointerCoords[i]; in obtainMotionEntry()
3076 return entry; in obtainMotionEntry()
3082 DispatchEntry* entry = mDispatchEntryPool.alloc(); in obtainDispatchEntry() local
3083 entry->eventEntry = eventEntry; in obtainDispatchEntry()
3085 entry->targetFlags = targetFlags; in obtainDispatchEntry()
3086 entry->xOffset = xOffset; in obtainDispatchEntry()
3087 entry->yOffset = yOffset; in obtainDispatchEntry()
3088 entry->inProgress = false; in obtainDispatchEntry()
3089 entry->headMotionSample = NULL; in obtainDispatchEntry()
3090 entry->tailMotionSample = NULL; in obtainDispatchEntry()
3091 return entry; in obtainDispatchEntry()
3095 CommandEntry* entry = mCommandEntryPool.alloc(); in obtainCommandEntry() local
3096 entry->command = command; in obtainCommandEntry()
3097 return entry; in obtainCommandEntry()
3109 void InputDispatcher::Allocator::releaseEventEntry(EventEntry* entry) { in releaseEventEntry() argument
3110 switch (entry->type) { in releaseEventEntry()
3112 releaseConfigurationChangedEntry(static_cast<ConfigurationChangedEntry*>(entry)); in releaseEventEntry()
3115 releaseKeyEntry(static_cast<KeyEntry*>(entry)); in releaseEventEntry()
3118 releaseMotionEntry(static_cast<MotionEntry*>(entry)); in releaseEventEntry()
3127 ConfigurationChangedEntry* entry) { in releaseConfigurationChangedEntry() argument
3128 entry->refCount -= 1; in releaseConfigurationChangedEntry()
3129 if (entry->refCount == 0) { in releaseConfigurationChangedEntry()
3130 releaseEventEntryInjectionState(entry); in releaseConfigurationChangedEntry()
3131 mConfigurationChangeEntryPool.free(entry); in releaseConfigurationChangedEntry()
3133 assert(entry->refCount > 0); in releaseConfigurationChangedEntry()
3137 void InputDispatcher::Allocator::releaseKeyEntry(KeyEntry* entry) { in releaseKeyEntry() argument
3138 entry->refCount -= 1; in releaseKeyEntry()
3139 if (entry->refCount == 0) { in releaseKeyEntry()
3140 releaseEventEntryInjectionState(entry); in releaseKeyEntry()
3141 mKeyEntryPool.free(entry); in releaseKeyEntry()
3143 assert(entry->refCount > 0); in releaseKeyEntry()
3147 void InputDispatcher::Allocator::releaseMotionEntry(MotionEntry* entry) { in releaseMotionEntry() argument
3148 entry->refCount -= 1; in releaseMotionEntry()
3149 if (entry->refCount == 0) { in releaseMotionEntry()
3150 releaseEventEntryInjectionState(entry); in releaseMotionEntry()
3151 for (MotionSample* sample = entry->firstSample.next; sample != NULL; ) { in releaseMotionEntry()
3156 mMotionEntryPool.free(entry); in releaseMotionEntry()
3158 assert(entry->refCount > 0); in releaseMotionEntry()
3162 void InputDispatcher::Allocator::releaseDispatchEntry(DispatchEntry* entry) { in releaseDispatchEntry() argument
3163 releaseEventEntry(entry->eventEntry); in releaseDispatchEntry()
3164 mDispatchEntryPool.free(entry); in releaseDispatchEntry()
3167 void InputDispatcher::Allocator::releaseCommandEntry(CommandEntry* entry) { in releaseCommandEntry() argument
3168 mCommandEntryPool.free(entry); in releaseCommandEntry()
3218 const EventEntry* entry) { in trackEvent() argument
3219 switch (entry->type) { in trackEvent()
3221 return trackKey(static_cast<const KeyEntry*>(entry)); in trackEvent()
3224 return trackMotion(static_cast<const MotionEntry*>(entry)); in trackEvent()
3232 const KeyEntry* entry) { in trackKey() argument
3233 int32_t action = entry->action; in trackKey()
3236 if (memento.deviceId == entry->deviceId in trackKey()
3237 && memento.source == entry->source in trackKey()
3238 && memento.keyCode == entry->keyCode in trackKey()
3239 && memento.scanCode == entry->scanCode) { in trackKey()
3258 memento.deviceId = entry->deviceId; in trackKey()
3259 memento.source = entry->source; in trackKey()
3260 memento.keyCode = entry->keyCode; in trackKey()
3261 memento.scanCode = entry->scanCode; in trackKey()
3262 memento.downTime = entry->downTime; in trackKey()
3272 const MotionEntry* entry) { in trackMotion() argument
3273 int32_t action = entry->action & AMOTION_EVENT_ACTION_MASK; in trackMotion()
3276 if (memento.deviceId == entry->deviceId in trackMotion()
3277 && memento.source == entry->source) { in trackMotion()
3288 if (entry->pointerCount == memento.pointerCount + 1) { in trackMotion()
3289 memento.setPointers(entry); in trackMotion()
3295 if (entry->pointerCount == memento.pointerCount - 1) { in trackMotion()
3296 memento.setPointers(entry); in trackMotion()
3302 if (entry->pointerCount == memento.pointerCount) { in trackMotion()
3317 memento.deviceId = entry->deviceId; in trackMotion()
3318 memento.source = entry->source; in trackMotion()
3319 memento.xPrecision = entry->xPrecision; in trackMotion()
3320 memento.yPrecision = entry->yPrecision; in trackMotion()
3321 memento.downTime = entry->downTime; in trackMotion()
3322 memento.setPointers(entry); in trackMotion()
3331 void InputDispatcher::InputState::MotionMemento::setPointers(const MotionEntry* entry) { in setPointers() argument
3332 pointerCount = entry->pointerCount; in setPointers()
3333 for (uint32_t i = 0; i < entry->pointerCount; i++) { in setPointers()
3334 pointerIds[i] = entry->pointerIds[i]; in setPointers()
3335 pointerCoords[i] = entry->lastSample->pointerCoords[i]; in setPointers()