Lines Matching refs:connection

660         commandEntry->connection.clear();  in runCommandsLockedInterruptible()
1009 sp<Connection> connection = mConnectionsByFd.valueAt(connectionIndex); in dispatchEventLocked() local
1010 prepareDispatchCycleLocked(currentTime, connection, eventEntry, &inputTarget); in dispatchEventLocked()
1108 sp<Connection> connection = mConnectionsByFd.valueAt(connectionIndex); in resumeAfterTargetsNotReadyTimeoutLocked() local
1109 sp<IBinder> token = connection->inputChannel->getToken(); in resumeAfterTargetsNotReadyTimeoutLocked()
1115 if (connection->status == Connection::STATUS_NORMAL) { in resumeAfterTargetsNotReadyTimeoutLocked()
1118 synthesizeCancelationEventsForConnectionLocked(connection, options); in resumeAfterTargetsNotReadyTimeoutLocked()
1804 sp<Connection> connection = mConnectionsByFd.valueAt(connectionIndex); in checkWindowReadyForMoreInputLocked() local
1805 if (connection->status != Connection::STATUS_NORMAL) { in checkWindowReadyForMoreInputLocked()
1808 targetType, connection->getStatusLabel()); in checkWindowReadyForMoreInputLocked()
1812 if (connection->inputPublisherBlocked) { in checkWindowReadyForMoreInputLocked()
1815 targetType, connection->outboundQueue.count(), in checkWindowReadyForMoreInputLocked()
1816 connection->waitQueue.count()); in checkWindowReadyForMoreInputLocked()
1832 if (!connection->outboundQueue.isEmpty() || !connection->waitQueue.isEmpty()) { in checkWindowReadyForMoreInputLocked()
1837 targetType, connection->outboundQueue.count(), in checkWindowReadyForMoreInputLocked()
1838 connection->waitQueue.count()); in checkWindowReadyForMoreInputLocked()
1856 if (!connection->waitQueue.isEmpty() && in checkWindowReadyForMoreInputLocked()
1857 currentTime >= connection->waitQueue.head->deliveryTime + STREAM_AHEAD_EVENT_TIMEOUT) { in checkWindowReadyForMoreInputLocked()
1864 connection->waitQueue.count(), in checkWindowReadyForMoreInputLocked()
1865 (currentTime - connection->waitQueue.head->deliveryTime) * in checkWindowReadyForMoreInputLocked()
1935 const sp<Connection>& connection, in prepareDispatchCycleLocked() argument
1941 connection->getInputChannelName().c_str(), eventEntry->sequenceNum); in prepareDispatchCycleLocked()
1948 connection->getInputChannelName().c_str(), inputTarget->flags, inputTarget->xOffset, in prepareDispatchCycleLocked()
1955 if (connection->status != Connection::STATUS_NORMAL) { in prepareDispatchCycleLocked()
1958 connection->getInputChannelName().c_str(), connection->getStatusLabel()); in prepareDispatchCycleLocked()
1975 ALOGD("channel '%s' ~ Split motion event.", connection->getInputChannelName().c_str()); in prepareDispatchCycleLocked()
1978 enqueueDispatchEntriesLocked(currentTime, connection, splitMotionEntry, inputTarget); in prepareDispatchCycleLocked()
1985 enqueueDispatchEntriesLocked(currentTime, connection, eventEntry, inputTarget); in prepareDispatchCycleLocked()
1989 const sp<Connection>& connection, in enqueueDispatchEntriesLocked() argument
1996 connection->getInputChannelName().c_str(), eventEntry->sequenceNum); in enqueueDispatchEntriesLocked()
2000 bool wasEmpty = connection->outboundQueue.isEmpty(); in enqueueDispatchEntriesLocked()
2003 enqueueDispatchEntryLocked(connection, eventEntry, inputTarget, in enqueueDispatchEntriesLocked()
2005 enqueueDispatchEntryLocked(connection, eventEntry, inputTarget, in enqueueDispatchEntriesLocked()
2007 enqueueDispatchEntryLocked(connection, eventEntry, inputTarget, in enqueueDispatchEntriesLocked()
2009 enqueueDispatchEntryLocked(connection, eventEntry, inputTarget, in enqueueDispatchEntriesLocked()
2011 enqueueDispatchEntryLocked(connection, eventEntry, inputTarget, in enqueueDispatchEntriesLocked()
2013 enqueueDispatchEntryLocked(connection, eventEntry, inputTarget, in enqueueDispatchEntriesLocked()
2017 if (wasEmpty && !connection->outboundQueue.isEmpty()) { in enqueueDispatchEntriesLocked()
2018 startDispatchCycleLocked(currentTime, connection); in enqueueDispatchEntriesLocked()
2022 void InputDispatcher::enqueueDispatchEntryLocked(const sp<Connection>& connection, in enqueueDispatchEntryLocked() argument
2028 connection->getInputChannelName().c_str(), in enqueueDispatchEntryLocked()
2053 if (!connection->inputState.trackKey(keyEntry, dispatchEntry->resolvedAction, in enqueueDispatchEntryLocked()
2057 connection->getInputChannelName().c_str()); in enqueueDispatchEntryLocked()
2081 !connection->inputState.isHovering(motionEntry->deviceId, motionEntry->source, in enqueueDispatchEntryLocked()
2086 connection->getInputChannelName().c_str()); in enqueueDispatchEntryLocked()
2099 if (!connection->inputState.trackMotion(motionEntry, dispatchEntry->resolvedAction, in enqueueDispatchEntryLocked()
2104 connection->getInputChannelName().c_str()); in enqueueDispatchEntryLocked()
2123 connection->outboundQueue.enqueueAtTail(dispatchEntry); in enqueueDispatchEntryLocked()
2124 traceOutboundQueueLength(connection); in enqueueDispatchEntryLocked()
2155 const sp<Connection>& connection) { in startDispatchCycleLocked() argument
2158 connection->getInputChannelName().c_str()); in startDispatchCycleLocked()
2162 ALOGD("channel '%s' ~ startDispatchCycle", connection->getInputChannelName().c_str()); in startDispatchCycleLocked()
2165 while (connection->status == Connection::STATUS_NORMAL && in startDispatchCycleLocked()
2166 !connection->outboundQueue.isEmpty()) { in startDispatchCycleLocked()
2167 DispatchEntry* dispatchEntry = connection->outboundQueue.head; in startDispatchCycleLocked()
2178 status = connection->inputPublisher in startDispatchCycleLocked()
2225 status = connection->inputPublisher in startDispatchCycleLocked()
2250 if (connection->waitQueue.isEmpty()) { in startDispatchCycleLocked()
2255 connection->getInputChannelName().c_str(), status); in startDispatchCycleLocked()
2256 abortBrokenDispatchCycleLocked(currentTime, connection, true /*notify*/); in startDispatchCycleLocked()
2263 connection->getInputChannelName().c_str()); in startDispatchCycleLocked()
2265 connection->inputPublisherBlocked = true; in startDispatchCycleLocked()
2270 connection->getInputChannelName().c_str(), status); in startDispatchCycleLocked()
2271 abortBrokenDispatchCycleLocked(currentTime, connection, true /*notify*/); in startDispatchCycleLocked()
2277 connection->outboundQueue.dequeue(dispatchEntry); in startDispatchCycleLocked()
2278 traceOutboundQueueLength(connection); in startDispatchCycleLocked()
2279 connection->waitQueue.enqueueAtTail(dispatchEntry); in startDispatchCycleLocked()
2280 traceWaitQueueLength(connection); in startDispatchCycleLocked()
2285 const sp<Connection>& connection, uint32_t seq, in finishDispatchCycleLocked() argument
2289 connection->getInputChannelName().c_str(), seq, toString(handled)); in finishDispatchCycleLocked()
2292 connection->inputPublisherBlocked = false; in finishDispatchCycleLocked()
2294 if (connection->status == Connection::STATUS_BROKEN || in finishDispatchCycleLocked()
2295 connection->status == Connection::STATUS_ZOMBIE) { in finishDispatchCycleLocked()
2300 onDispatchCycleFinishedLocked(currentTime, connection, seq, handled); in finishDispatchCycleLocked()
2304 const sp<Connection>& connection, in abortBrokenDispatchCycleLocked() argument
2308 connection->getInputChannelName().c_str(), toString(notify)); in abortBrokenDispatchCycleLocked()
2312 drainDispatchQueue(&connection->outboundQueue); in abortBrokenDispatchCycleLocked()
2313 traceOutboundQueueLength(connection); in abortBrokenDispatchCycleLocked()
2314 drainDispatchQueue(&connection->waitQueue); in abortBrokenDispatchCycleLocked()
2315 traceWaitQueueLength(connection); in abortBrokenDispatchCycleLocked()
2319 if (connection->status == Connection::STATUS_NORMAL) { in abortBrokenDispatchCycleLocked()
2320 connection->status = Connection::STATUS_BROKEN; in abortBrokenDispatchCycleLocked()
2324 onDispatchCycleBrokenLocked(currentTime, connection); in abortBrokenDispatchCycleLocked()
2358 sp<Connection> connection = d->mConnectionsByFd.valueAt(connectionIndex); in handleReceiveCallback() local
2363 connection->getInputChannelName().c_str(), events); in handleReceiveCallback()
2373 status = connection->inputPublisher.receiveFinishedSignal(&seq, &handled); in handleReceiveCallback()
2377 d->finishDispatchCycleLocked(currentTime, connection, seq, handled); in handleReceiveCallback()
2387 notify = status != DEAD_OBJECT || !connection->monitor; in handleReceiveCallback()
2390 connection->getInputChannelName().c_str(), status); in handleReceiveCallback()
2396 notify = !connection->monitor; in handleReceiveCallback()
2400 connection->getInputChannelName().c_str(), events); in handleReceiveCallback()
2405 d->unregisterInputChannelLocked(connection->inputChannel, notify); in handleReceiveCallback()
2443 const sp<Connection>& connection, const CancelationOptions& options) { in synthesizeCancelationEventsForConnectionLocked() argument
2444 if (connection->status == Connection::STATUS_BROKEN) { in synthesizeCancelationEventsForConnectionLocked()
2451 connection->inputState.synthesizeCancelationEvents(currentTime, cancelationEvents, options); in synthesizeCancelationEventsForConnectionLocked()
2457 connection->getInputChannelName().c_str(), cancelationEvents.size(), options.reason, in synthesizeCancelationEventsForConnectionLocked()
2475 getWindowHandleLocked(connection->inputChannel->getToken()); in synthesizeCancelationEventsForConnectionLocked()
2488 target.inputChannel = connection->inputChannel; in synthesizeCancelationEventsForConnectionLocked()
2491 enqueueDispatchEntryLocked(connection, cancelationEventEntry, // increments ref in synthesizeCancelationEventsForConnectionLocked()
2497 startDispatchCycleLocked(currentTime, connection); in synthesizeCancelationEventsForConnectionLocked()
3755 const sp<Connection>& connection = mConnectionsByFd.valueAt(i); in dumpDispatchStateLocked() local
3758 i, connection->getInputChannelName().c_str(), in dumpDispatchStateLocked()
3759 connection->getWindowName().c_str(), connection->getStatusLabel(), in dumpDispatchStateLocked()
3760 toString(connection->monitor), in dumpDispatchStateLocked()
3761 toString(connection->inputPublisherBlocked)); in dumpDispatchStateLocked()
3763 if (!connection->outboundQueue.isEmpty()) { in dumpDispatchStateLocked()
3765 connection->outboundQueue.count()); in dumpDispatchStateLocked()
3766 for (DispatchEntry* entry = connection->outboundQueue.head; entry; in dumpDispatchStateLocked()
3778 if (!connection->waitQueue.isEmpty()) { in dumpDispatchStateLocked()
3780 connection->waitQueue.count()); in dumpDispatchStateLocked()
3781 for (DispatchEntry* entry = connection->waitQueue.head; entry; in dumpDispatchStateLocked()
3838 sp<Connection> connection = new Connection(inputChannel, false /*monitor*/); in registerInputChannel() local
3841 mConnectionsByFd.add(fd, connection); in registerInputChannel()
3867 sp<Connection> connection = new Connection(inputChannel, true /*monitor*/); in registerInputMonitor() local
3870 mConnectionsByFd.add(fd, connection); in registerInputMonitor()
3913 sp<Connection> connection = mConnectionsByFd.valueAt(connectionIndex); in unregisterInputChannelLocked() local
3918 if (connection->monitor) { in unregisterInputChannelLocked()
3925 abortBrokenDispatchCycleLocked(currentTime, connection, notify); in unregisterInputChannelLocked()
3927 connection->status = Connection::STATUS_ZOMBIE; in unregisterInputChannelLocked()
4021 sp<Connection> connection = mConnectionsByFd.valueAt(i); in getConnectionIndexLocked() local
4022 if (connection->inputChannel->getToken() == inputChannel->getToken()) { in getConnectionIndexLocked()
4031 const sp<Connection>& connection, uint32_t seq, in onDispatchCycleFinishedLocked() argument
4035 commandEntry->connection = connection; in onDispatchCycleFinishedLocked()
4042 const sp<Connection>& connection) { in onDispatchCycleBrokenLocked() argument
4044 connection->getInputChannelName().c_str()); in onDispatchCycleBrokenLocked()
4048 commandEntry->connection = connection; in onDispatchCycleBrokenLocked()
4106 sp<Connection> connection = commandEntry->connection; in doNotifyInputChannelBrokenLockedInterruptible() local
4108 if (connection->status != Connection::STATUS_ZOMBIE) { in doNotifyInputChannelBrokenLockedInterruptible()
4111 mPolicy->notifyInputChannelBroken(connection->inputChannel->getToken()); in doNotifyInputChannelBrokenLockedInterruptible()
4178 sp<Connection> connection = commandEntry->connection; in doDispatchCycleFinishedLockedInterruptible() local
4184 DispatchEntry* dispatchEntry = connection->findWaitQueueEntry(seq); in doDispatchCycleFinishedLockedInterruptible()
4190 connection->getWindowName().c_str(), eventDuration * 0.000001f); in doDispatchCycleFinishedLockedInterruptible()
4199 afterKeyEventLockedInterruptible(connection, dispatchEntry, keyEntry, handled); in doDispatchCycleFinishedLockedInterruptible()
4202 restartEvent = afterMotionEventLockedInterruptible(connection, dispatchEntry, in doDispatchCycleFinishedLockedInterruptible()
4212 if (dispatchEntry == connection->findWaitQueueEntry(seq)) { in doDispatchCycleFinishedLockedInterruptible()
4213 connection->waitQueue.dequeue(dispatchEntry); in doDispatchCycleFinishedLockedInterruptible()
4214 traceWaitQueueLength(connection); in doDispatchCycleFinishedLockedInterruptible()
4215 if (restartEvent && connection->status == Connection::STATUS_NORMAL) { in doDispatchCycleFinishedLockedInterruptible()
4216 connection->outboundQueue.enqueueAtHead(dispatchEntry); in doDispatchCycleFinishedLockedInterruptible()
4217 traceOutboundQueueLength(connection); in doDispatchCycleFinishedLockedInterruptible()
4224 startDispatchCycleLocked(now(), connection); in doDispatchCycleFinishedLockedInterruptible()
4228 bool InputDispatcher::afterKeyEventLockedInterruptible(const sp<Connection>& connection, in afterKeyEventLockedInterruptible() argument
4242 int32_t fallbackKeyCode = connection->inputState.getFallbackKey(originalKeyCode); in afterKeyEventLockedInterruptible()
4244 connection->inputState.removeFallbackKey(originalKeyCode); in afterKeyEventLockedInterruptible()
4265 mPolicy->dispatchUnhandledKey(connection->inputChannel->getToken(), &event, in afterKeyEventLockedInterruptible()
4277 synthesizeCancelationEventsForConnectionLocked(connection, options); in afterKeyEventLockedInterruptible()
4279 connection->inputState.removeFallbackKey(originalKeyCode); in afterKeyEventLockedInterruptible()
4307 bool fallback = mPolicy->dispatchUnhandledKey(connection->inputChannel->getToken(), &event, in afterKeyEventLockedInterruptible()
4312 if (connection->status != Connection::STATUS_NORMAL) { in afterKeyEventLockedInterruptible()
4313 connection->inputState.removeFallbackKey(originalKeyCode); in afterKeyEventLockedInterruptible()
4325 connection->inputState.setFallbackKey(originalKeyCode, fallbackKeyCode); in afterKeyEventLockedInterruptible()
4352 synthesizeCancelationEventsForConnectionLocked(connection, options); in afterKeyEventLockedInterruptible()
4357 connection->inputState.setFallbackKey(originalKeyCode, fallbackKeyCode); in afterKeyEventLockedInterruptible()
4365 connection->inputState.getFallbackKeys(); in afterKeyEventLockedInterruptible()
4406 bool InputDispatcher::afterMotionEventLockedInterruptible(const sp<Connection>& connection, in afterMotionEventLockedInterruptible() argument
4438 void InputDispatcher::traceOutboundQueueLength(const sp<Connection>& connection) { in traceOutboundQueueLength() argument
4441 snprintf(counterName, sizeof(counterName), "oq:%s", connection->getWindowName().c_str()); in traceOutboundQueueLength()
4442 ATRACE_INT(counterName, connection->outboundQueue.count()); in traceOutboundQueueLength()
4446 void InputDispatcher::traceWaitQueueLength(const sp<Connection>& connection) { in traceWaitQueueLength() argument
4449 snprintf(counterName, sizeof(counterName), "wq:%s", connection->getWindowName().c_str()); in traceWaitQueueLength()
4450 ATRACE_INT(counterName, connection->waitQueue.count()); in traceWaitQueueLength()