Loading services/inputflinger/dispatcher/Connection.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -28,8 +28,6 @@ Connection::Connection(const std::shared_ptr<InputChannel>& inputChannel, bool m inputPublisher(inputChannel), inputState(idGenerator) {} Connection::~Connection() {} const std::string Connection::getWindowName() const { if (inputChannel != nullptr) { return inputChannel->getName(); Loading services/inputflinger/dispatcher/Connection.h +1 −4 Original line number Diff line number Diff line Loading @@ -27,10 +27,7 @@ namespace android::inputdispatcher { struct DispatchEntry; /* Manages the dispatch state associated with a single input channel. */ class Connection : public RefBase { protected: virtual ~Connection(); class Connection { public: enum class Status { // Everything is peachy. Loading services/inputflinger/dispatcher/InputDispatcher.cpp +51 −44 Original line number Diff line number Diff line Loading @@ -688,7 +688,7 @@ InputDispatcher::~InputDispatcher() { mCommandQueue.clear(); while (!mConnectionsByToken.empty()) { sp<Connection> connection = mConnectionsByToken.begin()->second; std::shared_ptr<Connection> connection = mConnectionsByToken.begin()->second; removeInputChannelLocked(connection->inputChannel->getConnectionToken(), /*notify=*/false); } } Loading Loading @@ -802,7 +802,7 @@ nsecs_t InputDispatcher::processAnrsLocked() { } // If we reached here, we have an unresponsive connection. sp<Connection> connection = getConnectionLocked(mAnrTracker.firstToken()); std::shared_ptr<Connection> connection = getConnectionLocked(mAnrTracker.firstToken()); if (connection == nullptr) { ALOGE("Could not find connection for entry %" PRId64, mAnrTracker.firstTimeout()); return nextAnrCheck; Loading @@ -815,7 +815,7 @@ nsecs_t InputDispatcher::processAnrsLocked() { } std::chrono::nanoseconds InputDispatcher::getDispatchingTimeoutLocked( const sp<Connection>& connection) { const std::shared_ptr<Connection>& connection) { if (connection->monitor) { return mMonitorDispatchingTimeout; } Loading Loading @@ -1058,7 +1058,8 @@ bool InputDispatcher::shouldPruneInboundQueueLocked(const MotionEntry& motionEnt const std::vector<sp<WindowInfoHandle>> touchedSpies = findTouchedSpyWindowsAtLocked(displayId, x, y, isStylus); for (const auto& windowHandle : touchedSpies) { const sp<Connection> connection = getConnectionLocked(windowHandle->getToken()); const std::shared_ptr<Connection> connection = getConnectionLocked(windowHandle->getToken()); if (connection != nullptr && connection->responsive) { // This spy window could take more input. Drop all events preceding this // event, so that the spy window can get a chance to receive the stream. Loading Loading @@ -1895,7 +1896,7 @@ void InputDispatcher::dispatchEventLocked(nsecs_t currentTime, pokeUserActivityLocked(*eventEntry); for (const InputTarget& inputTarget : inputTargets) { sp<Connection> connection = std::shared_ptr<Connection> connection = getConnectionLocked(inputTarget.inputChannel->getConnectionToken()); if (connection != nullptr) { prepareDispatchCycleLocked(currentTime, connection, eventEntry, inputTarget); Loading @@ -1909,7 +1910,7 @@ void InputDispatcher::dispatchEventLocked(nsecs_t currentTime, } } void InputDispatcher::cancelEventsForAnrLocked(const sp<Connection>& connection) { void InputDispatcher::cancelEventsForAnrLocked(const std::shared_ptr<Connection>& connection) { // We will not be breaking any connections here, even if the policy wants us to abort dispatch. // If the policy decides to close the app, we will get a channel removal event via // unregisterInputChannel, and will clean up the connection that way. We are already not Loading Loading @@ -2101,7 +2102,7 @@ std::vector<Monitor> InputDispatcher::selectResponsiveMonitorsLocked( std::vector<Monitor> responsiveMonitors; std::copy_if(monitors.begin(), monitors.end(), std::back_inserter(responsiveMonitors), [this](const Monitor& monitor) REQUIRES(mLock) { sp<Connection> connection = std::shared_ptr<Connection> connection = getConnectionLocked(monitor.inputChannel->getConnectionToken()); if (connection == nullptr) { ALOGE("Could not find connection for monitor %s", Loading Loading @@ -3027,7 +3028,7 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry& eventEntry) { } void InputDispatcher::prepareDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry> eventEntry, const InputTarget& inputTarget) { if (ATRACE_ENABLED()) { Loading Loading @@ -3097,7 +3098,7 @@ void InputDispatcher::prepareDispatchCycleLocked(nsecs_t currentTime, } void InputDispatcher::enqueueDispatchEntriesLocked(nsecs_t currentTime, const sp<Connection>& connection, const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry> eventEntry, const InputTarget& inputTarget) { if (ATRACE_ENABLED()) { Loading Loading @@ -3131,7 +3132,7 @@ void InputDispatcher::enqueueDispatchEntriesLocked(nsecs_t currentTime, } } void InputDispatcher::enqueueDispatchEntryLocked(const sp<Connection>& connection, void InputDispatcher::enqueueDispatchEntryLocked(const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry> eventEntry, const InputTarget& inputTarget, ftl::Flags<InputTarget::Flags> dispatchMode) { Loading Loading @@ -3316,14 +3317,14 @@ void InputDispatcher::updateInteractionTokensLocked(const EventEntry& entry, } std::unordered_set<sp<IBinder>, StrongPointerHash<IBinder>> newConnectionTokens; std::vector<sp<Connection>> newConnections; std::vector<std::shared_ptr<Connection>> newConnections; for (const InputTarget& target : targets) { if (target.flags.test(InputTarget::Flags::DISPATCH_AS_OUTSIDE)) { continue; // Skip windows that receive ACTION_OUTSIDE } sp<IBinder> token = target.inputChannel->getConnectionToken(); sp<Connection> connection = getConnectionLocked(token); std::shared_ptr<Connection> connection = getConnectionLocked(token); if (connection == nullptr) { continue; } Loading @@ -3336,7 +3337,7 @@ void InputDispatcher::updateInteractionTokensLocked(const EventEntry& entry, mInteractionConnectionTokens = newConnectionTokens; std::string targetList; for (const sp<Connection>& connection : newConnections) { for (const std::shared_ptr<Connection>& connection : newConnections) { targetList += connection->getWindowName() + ", "; } std::string message = "Interaction with: " + targetList; Loading Loading @@ -3416,7 +3417,7 @@ status_t InputDispatcher::publishMotionEvent(Connection& connection, } void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection) { const std::shared_ptr<Connection>& connection) { if (ATRACE_ENABLED()) { std::string message = StringPrintf("startDispatchCycleLocked(inputChannel=%s)", connection->getInputChannelName().c_str()); Loading Loading @@ -3596,8 +3597,8 @@ const std::array<uint8_t, 32> InputDispatcher::getSignature( } void InputDispatcher::finishDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) { const std::shared_ptr<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) { if (DEBUG_DISPATCH_CYCLE) { ALOGD("channel '%s' ~ finishDispatchCycle - seq=%u, handled=%s", connection->getInputChannelName().c_str(), seq, toString(handled)); Loading @@ -3616,7 +3617,7 @@ void InputDispatcher::finishDispatchCycleLocked(nsecs_t currentTime, } void InputDispatcher::abortBrokenDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, const std::shared_ptr<Connection>& connection, bool notify) { if (DEBUG_DISPATCH_CYCLE) { LOG(DEBUG) << "channel '" << connection->getInputChannelName() << "'~ " << __func__ Loading Loading @@ -3665,7 +3666,7 @@ void InputDispatcher::releaseDispatchEntry(DispatchEntry* dispatchEntry) { int InputDispatcher::handleReceiveCallback(int events, sp<IBinder> connectionToken) { std::scoped_lock _l(mLock); sp<Connection> connection = getConnectionLocked(connectionToken); std::shared_ptr<Connection> connection = getConnectionLocked(connectionToken); if (connection == nullptr) { ALOGW("Received looper callback for unknown input channel token %p. events=0x%x", connectionToken.get(), events); Loading Loading @@ -3757,7 +3758,7 @@ void InputDispatcher::synthesizeCancelationEventsForMonitorsLocked( void InputDispatcher::synthesizeCancelationEventsForInputChannelLocked( const std::shared_ptr<InputChannel>& channel, const CancelationOptions& options) { sp<Connection> connection = getConnectionLocked(channel->getConnectionToken()); std::shared_ptr<Connection> connection = getConnectionLocked(channel->getConnectionToken()); if (connection == nullptr) { return; } Loading @@ -3766,7 +3767,7 @@ void InputDispatcher::synthesizeCancelationEventsForInputChannelLocked( } void InputDispatcher::synthesizeCancelationEventsForConnectionLocked( const sp<Connection>& connection, const CancelationOptions& options) { const std::shared_ptr<Connection>& connection, const CancelationOptions& options) { if (connection->status == Connection::Status::BROKEN) { return; } Loading Loading @@ -3844,7 +3845,7 @@ void InputDispatcher::synthesizeCancelationEventsForConnectionLocked( } void InputDispatcher::synthesizePointerDownEventsForConnectionLocked( const nsecs_t downTime, const sp<Connection>& connection, const nsecs_t downTime, const std::shared_ptr<Connection>& connection, ftl::Flags<InputTarget::Flags> targetFlags) { if (connection->status == Connection::Status::BROKEN) { return; Loading Loading @@ -3909,7 +3910,8 @@ void InputDispatcher::synthesizePointerDownEventsForConnectionLocked( void InputDispatcher::synthesizeCancelationEventsForWindowLocked( const sp<WindowInfoHandle>& windowHandle, const CancelationOptions& options) { if (windowHandle != nullptr) { sp<Connection> wallpaperConnection = getConnectionLocked(windowHandle->getToken()); std::shared_ptr<Connection> wallpaperConnection = getConnectionLocked(windowHandle->getToken()); if (wallpaperConnection != nullptr) { synthesizeCancelationEventsForConnectionLocked(wallpaperConnection, options); } Loading Loading @@ -4796,7 +4798,7 @@ bool InputDispatcher::canWindowReceiveMotionLocked(const sp<WindowInfoHandle>& w return false; } sp<Connection> connection = getConnectionLocked(window->getToken()); std::shared_ptr<Connection> connection = getConnectionLocked(window->getToken()); if (connection == nullptr) { ALOGW("Not sending touch to %s because there's no corresponding connection", window->getName().c_str()); Loading Loading @@ -5318,8 +5320,8 @@ bool InputDispatcher::transferTouchFocus(const sp<IBinder>& fromToken, const sp< } // Synthesize cancel for old window and down for new window. sp<Connection> fromConnection = getConnectionLocked(fromToken); sp<Connection> toConnection = getConnectionLocked(toToken); std::shared_ptr<Connection> fromConnection = getConnectionLocked(fromToken); std::shared_ptr<Connection> toConnection = getConnectionLocked(toToken); if (fromConnection != nullptr && toConnection != nullptr) { fromConnection->inputState.mergePointerStateTo(toConnection->inputState); CancelationOptions Loading Loading @@ -5685,8 +5687,9 @@ Result<std::unique_ptr<InputChannel>> InputDispatcher::createInputChannel(const std::scoped_lock _l(mLock); const sp<IBinder>& token = serverChannel->getConnectionToken(); int fd = serverChannel->getFd(); sp<Connection> connection = sp<Connection>::make(std::move(serverChannel), /*monitor=*/false, mIdGenerator); std::shared_ptr<Connection> connection = std::make_shared<Connection>(std::move(serverChannel), /*monitor=*/false, mIdGenerator); if (mConnectionsByToken.find(token) != mConnectionsByToken.end()) { ALOGE("Created a new connection, but the token %p is already known", token.get()); Loading Loading @@ -5723,8 +5726,8 @@ Result<std::unique_ptr<InputChannel>> InputDispatcher::createInputMonitor(int32_ << " without a specified display."; } sp<Connection> connection = sp<Connection>::make(serverChannel, /*monitor=*/true, mIdGenerator); std::shared_ptr<Connection> connection = std::make_shared<Connection>(serverChannel, /*monitor=*/true, mIdGenerator); const sp<IBinder>& token = serverChannel->getConnectionToken(); const int fd = serverChannel->getFd(); Loading Loading @@ -5764,7 +5767,7 @@ status_t InputDispatcher::removeInputChannel(const sp<IBinder>& connectionToken) status_t InputDispatcher::removeInputChannelLocked(const sp<IBinder>& connectionToken, bool notify) { sp<Connection> connection = getConnectionLocked(connectionToken); std::shared_ptr<Connection> connection = getConnectionLocked(connectionToken); if (connection == nullptr) { // Connection can be removed via socket hang up or an explicit call to 'removeInputChannel' return BAD_VALUE; Loading Loading @@ -5910,7 +5913,8 @@ std::optional<int32_t> InputDispatcher::findMonitorPidByTokenLocked(const sp<IBi return std::nullopt; } sp<Connection> InputDispatcher::getConnectionLocked(const sp<IBinder>& inputConnectionToken) const { std::shared_ptr<Connection> InputDispatcher::getConnectionLocked( const sp<IBinder>& inputConnectionToken) const { if (inputConnectionToken == nullptr) { return nullptr; } Loading @@ -5925,21 +5929,22 @@ sp<Connection> InputDispatcher::getConnectionLocked(const sp<IBinder>& inputConn } std::string InputDispatcher::getConnectionNameLocked(const sp<IBinder>& connectionToken) const { sp<Connection> connection = getConnectionLocked(connectionToken); std::shared_ptr<Connection> connection = getConnectionLocked(connectionToken); if (connection == nullptr) { return "<nullptr>"; } return connection->getInputChannelName(); } void InputDispatcher::removeConnectionLocked(const sp<Connection>& connection) { void InputDispatcher::removeConnectionLocked(const std::shared_ptr<Connection>& connection) { mAnrTracker.eraseToken(connection->inputChannel->getConnectionToken()); mConnectionsByToken.erase(connection->inputChannel->getConnectionToken()); } void InputDispatcher::doDispatchCycleFinishedCommand(nsecs_t finishTime, const sp<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) { const std::shared_ptr<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) { // Handle post-event policy actions. std::deque<DispatchEntry*>::iterator dispatchEntryIt = connection->findWaitQueueEntry(seq); if (dispatchEntryIt == connection->waitQueue.end()) { Loading Loading @@ -6017,7 +6022,7 @@ void InputDispatcher::sendDropWindowCommandLocked(const sp<IBinder>& token, floa postCommandLocked(std::move(command)); } void InputDispatcher::onAnrLocked(const sp<Connection>& connection) { void InputDispatcher::onAnrLocked(const std::shared_ptr<Connection>& connection) { if (connection == nullptr) { LOG_ALWAYS_FATAL("Caller must check for nullness"); } Loading Loading @@ -6179,8 +6184,8 @@ void InputDispatcher::processConnectionResponsiveLocked(const Connection& connec sendWindowResponsiveCommandLocked(connectionToken, pid); } bool InputDispatcher::afterKeyEventLockedInterruptable(const sp<Connection>& connection, DispatchEntry* dispatchEntry, bool InputDispatcher::afterKeyEventLockedInterruptable( const std::shared_ptr<Connection>& connection, DispatchEntry* dispatchEntry, KeyEntry& keyEntry, bool handled) { if (keyEntry.flags & AKEY_EVENT_FLAG_FALLBACK) { if (!handled) { Loading Loading @@ -6356,8 +6361,8 @@ bool InputDispatcher::afterKeyEventLockedInterruptable(const sp<Connection>& con return false; } bool InputDispatcher::afterMotionEventLockedInterruptable(const sp<Connection>& connection, DispatchEntry* dispatchEntry, bool InputDispatcher::afterMotionEventLockedInterruptable( const std::shared_ptr<Connection>& connection, DispatchEntry* dispatchEntry, MotionEntry& motionEntry, bool handled) { return false; } Loading Loading @@ -6680,9 +6685,11 @@ void InputDispatcher::transferWallpaperTouch(ftl::Flags<InputTarget::Flags> oldT wallpaperFlags |= InputTarget::Flags::WINDOW_IS_OBSCURED | InputTarget::Flags::WINDOW_IS_PARTIALLY_OBSCURED; state.addOrUpdateWindow(newWallpaper, wallpaperFlags, pointerIds, downTimeInTarget); sp<Connection> wallpaperConnection = getConnectionLocked(newWallpaper->getToken()); std::shared_ptr<Connection> wallpaperConnection = getConnectionLocked(newWallpaper->getToken()); if (wallpaperConnection != nullptr) { sp<Connection> toConnection = getConnectionLocked(toWindowHandle->getToken()); std::shared_ptr<Connection> toConnection = getConnectionLocked(toWindowHandle->getToken()); toConnection->inputState.mergePointerStateTo(wallpaperConnection->inputState); synthesizePointerDownEventsForConnectionLocked(downTimeInTarget, wallpaperConnection, wallpaperFlags); Loading services/inputflinger/dispatcher/InputDispatcher.h +31 −28 Original line number Diff line number Diff line Loading @@ -249,12 +249,12 @@ private: sp<android::gui::WindowInfoHandle> findTouchedForegroundWindowLocked(int32_t displayId) const REQUIRES(mLock); sp<Connection> getConnectionLocked(const sp<IBinder>& inputConnectionToken) const std::shared_ptr<Connection> getConnectionLocked(const sp<IBinder>& inputConnectionToken) const REQUIRES(mLock); std::string getConnectionNameLocked(const sp<IBinder>& connectionToken) const REQUIRES(mLock); void removeConnectionLocked(const sp<Connection>& connection) REQUIRES(mLock); void removeConnectionLocked(const std::shared_ptr<Connection>& connection) REQUIRES(mLock); status_t pilferPointersLocked(const sp<IBinder>& token) REQUIRES(mLock); Loading @@ -264,8 +264,8 @@ private: }; // All registered connections mapped by input channel token. std::unordered_map<sp<IBinder>, sp<Connection>, StrongPointerHash<IBinder>> mConnectionsByToken GUARDED_BY(mLock); std::unordered_map<sp<IBinder>, std::shared_ptr<Connection>, StrongPointerHash<IBinder>> mConnectionsByToken GUARDED_BY(mLock); // Find a monitor pid by the provided token. std::optional<int32_t> findMonitorPidByTokenLocked(const sp<IBinder>& token) REQUIRES(mLock); Loading Loading @@ -328,8 +328,8 @@ private: std::chrono::nanoseconds mMonitorDispatchingTimeout GUARDED_BY(mLock); nsecs_t processAnrsLocked() REQUIRES(mLock); std::chrono::nanoseconds getDispatchingTimeoutLocked(const sp<Connection>& connection) REQUIRES(mLock); std::chrono::nanoseconds getDispatchingTimeoutLocked( const std::shared_ptr<Connection>& connection) REQUIRES(mLock); // Input filter processing. bool shouldSendKeyToInputFilterLocked(const NotifyKeyArgs& args) REQUIRES(mLock); Loading Loading @@ -533,7 +533,7 @@ private: // prevent unneeded wakeups. AnrTracker mAnrTracker GUARDED_BY(mLock); void cancelEventsForAnrLocked(const sp<Connection>& connection) REQUIRES(mLock); void cancelEventsForAnrLocked(const std::shared_ptr<Connection>& connection) REQUIRES(mLock); // If a focused application changes, we should stop counting down the "no focused window" time, // because we will have no way of knowing when the previous application actually added a window. // This also means that we will miss cases like pulling down notification shade when the Loading Loading @@ -594,22 +594,26 @@ private: // These methods are deliberately not Interruptible because doing all of the work // with the mutex held makes it easier to ensure that connection invariants are maintained. // If needed, the methods post commands to run later once the critical bits are done. void prepareDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, void prepareDispatchCycleLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry>, const InputTarget& inputTarget) REQUIRES(mLock); void enqueueDispatchEntriesLocked(nsecs_t currentTime, const sp<Connection>& connection, void enqueueDispatchEntriesLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry>, const InputTarget& inputTarget) REQUIRES(mLock); void enqueueDispatchEntryLocked(const sp<Connection>& connection, std::shared_ptr<EventEntry>, const InputTarget& inputTarget, void enqueueDispatchEntryLocked(const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry>, const InputTarget& inputTarget, ftl::Flags<InputTarget::Flags> dispatchMode) REQUIRES(mLock); status_t publishMotionEvent(Connection& connection, DispatchEntry& dispatchEntry) const; void startDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection) void startDispatchCycleLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection) REQUIRES(mLock); void finishDispatchCycleLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) REQUIRES(mLock); void abortBrokenDispatchCycleLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection, bool notify) REQUIRES(mLock); void finishDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) REQUIRES(mLock); void abortBrokenDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, bool notify) REQUIRES(mLock); void drainDispatchQueue(std::deque<DispatchEntry*>& queue); void releaseDispatchEntry(DispatchEntry* dispatchEntry); int handleReceiveCallback(int events, sp<IBinder> connectionToken); Loading @@ -624,14 +628,13 @@ private: void synthesizeCancelationEventsForInputChannelLocked( const std::shared_ptr<InputChannel>& channel, const CancelationOptions& options) REQUIRES(mLock); void synthesizeCancelationEventsForConnectionLocked(const sp<Connection>& connection, const CancelationOptions& options) void synthesizeCancelationEventsForConnectionLocked( const std::shared_ptr<Connection>& connection, const CancelationOptions& options) REQUIRES(mLock); void synthesizePointerDownEventsForConnectionLocked(const nsecs_t downTime, const sp<Connection>& connection, ftl::Flags<InputTarget::Flags> targetFlags) REQUIRES(mLock); void synthesizePointerDownEventsForConnectionLocked( const nsecs_t downTime, const std::shared_ptr<Connection>& connection, ftl::Flags<InputTarget::Flags> targetFlags) REQUIRES(mLock); void synthesizeCancelationEventsForWindowLocked( const sp<android::gui::WindowInfoHandle>& windowHandle, Loading @@ -658,16 +661,16 @@ private: REQUIRES(mLock); // Interesting events that we might like to log or tell the framework about. void doDispatchCycleFinishedCommand(nsecs_t finishTime, const sp<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) REQUIRES(mLock); void doDispatchCycleFinishedCommand(nsecs_t finishTime, const std::shared_ptr<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) REQUIRES(mLock); void doInterceptKeyBeforeDispatchingCommand(const sp<IBinder>& focusedWindowToken, KeyEntry& entry) REQUIRES(mLock); void onFocusChangedLocked(const FocusResolver::FocusChanges& changes) REQUIRES(mLock); void sendFocusChangedCommandLocked(const sp<IBinder>& oldToken, const sp<IBinder>& newToken) REQUIRES(mLock); void sendDropWindowCommandLocked(const sp<IBinder>& token, float x, float y) REQUIRES(mLock); void onAnrLocked(const sp<Connection>& connection) REQUIRES(mLock); void onAnrLocked(const std::shared_ptr<Connection>& connection) REQUIRES(mLock); void onAnrLocked(std::shared_ptr<InputApplicationHandle> application) REQUIRES(mLock); void updateLastAnrStateLocked(const sp<android::gui::WindowInfoHandle>& window, const std::string& reason) REQUIRES(mLock); Loading @@ -675,10 +678,10 @@ private: const std::string& reason) REQUIRES(mLock); void updateLastAnrStateLocked(const std::string& windowLabel, const std::string& reason) REQUIRES(mLock); bool afterKeyEventLockedInterruptable(const sp<Connection>& connection, bool afterKeyEventLockedInterruptable(const std::shared_ptr<Connection>& connection, DispatchEntry* dispatchEntry, KeyEntry& keyEntry, bool handled) REQUIRES(mLock); bool afterMotionEventLockedInterruptable(const sp<Connection>& connection, bool afterMotionEventLockedInterruptable(const std::shared_ptr<Connection>& connection, DispatchEntry* dispatchEntry, MotionEntry& motionEntry, bool handled) REQUIRES(mLock); Loading Loading
services/inputflinger/dispatcher/Connection.cpp +0 −2 Original line number Diff line number Diff line Loading @@ -28,8 +28,6 @@ Connection::Connection(const std::shared_ptr<InputChannel>& inputChannel, bool m inputPublisher(inputChannel), inputState(idGenerator) {} Connection::~Connection() {} const std::string Connection::getWindowName() const { if (inputChannel != nullptr) { return inputChannel->getName(); Loading
services/inputflinger/dispatcher/Connection.h +1 −4 Original line number Diff line number Diff line Loading @@ -27,10 +27,7 @@ namespace android::inputdispatcher { struct DispatchEntry; /* Manages the dispatch state associated with a single input channel. */ class Connection : public RefBase { protected: virtual ~Connection(); class Connection { public: enum class Status { // Everything is peachy. Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +51 −44 Original line number Diff line number Diff line Loading @@ -688,7 +688,7 @@ InputDispatcher::~InputDispatcher() { mCommandQueue.clear(); while (!mConnectionsByToken.empty()) { sp<Connection> connection = mConnectionsByToken.begin()->second; std::shared_ptr<Connection> connection = mConnectionsByToken.begin()->second; removeInputChannelLocked(connection->inputChannel->getConnectionToken(), /*notify=*/false); } } Loading Loading @@ -802,7 +802,7 @@ nsecs_t InputDispatcher::processAnrsLocked() { } // If we reached here, we have an unresponsive connection. sp<Connection> connection = getConnectionLocked(mAnrTracker.firstToken()); std::shared_ptr<Connection> connection = getConnectionLocked(mAnrTracker.firstToken()); if (connection == nullptr) { ALOGE("Could not find connection for entry %" PRId64, mAnrTracker.firstTimeout()); return nextAnrCheck; Loading @@ -815,7 +815,7 @@ nsecs_t InputDispatcher::processAnrsLocked() { } std::chrono::nanoseconds InputDispatcher::getDispatchingTimeoutLocked( const sp<Connection>& connection) { const std::shared_ptr<Connection>& connection) { if (connection->monitor) { return mMonitorDispatchingTimeout; } Loading Loading @@ -1058,7 +1058,8 @@ bool InputDispatcher::shouldPruneInboundQueueLocked(const MotionEntry& motionEnt const std::vector<sp<WindowInfoHandle>> touchedSpies = findTouchedSpyWindowsAtLocked(displayId, x, y, isStylus); for (const auto& windowHandle : touchedSpies) { const sp<Connection> connection = getConnectionLocked(windowHandle->getToken()); const std::shared_ptr<Connection> connection = getConnectionLocked(windowHandle->getToken()); if (connection != nullptr && connection->responsive) { // This spy window could take more input. Drop all events preceding this // event, so that the spy window can get a chance to receive the stream. Loading Loading @@ -1895,7 +1896,7 @@ void InputDispatcher::dispatchEventLocked(nsecs_t currentTime, pokeUserActivityLocked(*eventEntry); for (const InputTarget& inputTarget : inputTargets) { sp<Connection> connection = std::shared_ptr<Connection> connection = getConnectionLocked(inputTarget.inputChannel->getConnectionToken()); if (connection != nullptr) { prepareDispatchCycleLocked(currentTime, connection, eventEntry, inputTarget); Loading @@ -1909,7 +1910,7 @@ void InputDispatcher::dispatchEventLocked(nsecs_t currentTime, } } void InputDispatcher::cancelEventsForAnrLocked(const sp<Connection>& connection) { void InputDispatcher::cancelEventsForAnrLocked(const std::shared_ptr<Connection>& connection) { // We will not be breaking any connections here, even if the policy wants us to abort dispatch. // If the policy decides to close the app, we will get a channel removal event via // unregisterInputChannel, and will clean up the connection that way. We are already not Loading Loading @@ -2101,7 +2102,7 @@ std::vector<Monitor> InputDispatcher::selectResponsiveMonitorsLocked( std::vector<Monitor> responsiveMonitors; std::copy_if(monitors.begin(), monitors.end(), std::back_inserter(responsiveMonitors), [this](const Monitor& monitor) REQUIRES(mLock) { sp<Connection> connection = std::shared_ptr<Connection> connection = getConnectionLocked(monitor.inputChannel->getConnectionToken()); if (connection == nullptr) { ALOGE("Could not find connection for monitor %s", Loading Loading @@ -3027,7 +3028,7 @@ void InputDispatcher::pokeUserActivityLocked(const EventEntry& eventEntry) { } void InputDispatcher::prepareDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry> eventEntry, const InputTarget& inputTarget) { if (ATRACE_ENABLED()) { Loading Loading @@ -3097,7 +3098,7 @@ void InputDispatcher::prepareDispatchCycleLocked(nsecs_t currentTime, } void InputDispatcher::enqueueDispatchEntriesLocked(nsecs_t currentTime, const sp<Connection>& connection, const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry> eventEntry, const InputTarget& inputTarget) { if (ATRACE_ENABLED()) { Loading Loading @@ -3131,7 +3132,7 @@ void InputDispatcher::enqueueDispatchEntriesLocked(nsecs_t currentTime, } } void InputDispatcher::enqueueDispatchEntryLocked(const sp<Connection>& connection, void InputDispatcher::enqueueDispatchEntryLocked(const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry> eventEntry, const InputTarget& inputTarget, ftl::Flags<InputTarget::Flags> dispatchMode) { Loading Loading @@ -3316,14 +3317,14 @@ void InputDispatcher::updateInteractionTokensLocked(const EventEntry& entry, } std::unordered_set<sp<IBinder>, StrongPointerHash<IBinder>> newConnectionTokens; std::vector<sp<Connection>> newConnections; std::vector<std::shared_ptr<Connection>> newConnections; for (const InputTarget& target : targets) { if (target.flags.test(InputTarget::Flags::DISPATCH_AS_OUTSIDE)) { continue; // Skip windows that receive ACTION_OUTSIDE } sp<IBinder> token = target.inputChannel->getConnectionToken(); sp<Connection> connection = getConnectionLocked(token); std::shared_ptr<Connection> connection = getConnectionLocked(token); if (connection == nullptr) { continue; } Loading @@ -3336,7 +3337,7 @@ void InputDispatcher::updateInteractionTokensLocked(const EventEntry& entry, mInteractionConnectionTokens = newConnectionTokens; std::string targetList; for (const sp<Connection>& connection : newConnections) { for (const std::shared_ptr<Connection>& connection : newConnections) { targetList += connection->getWindowName() + ", "; } std::string message = "Interaction with: " + targetList; Loading Loading @@ -3416,7 +3417,7 @@ status_t InputDispatcher::publishMotionEvent(Connection& connection, } void InputDispatcher::startDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection) { const std::shared_ptr<Connection>& connection) { if (ATRACE_ENABLED()) { std::string message = StringPrintf("startDispatchCycleLocked(inputChannel=%s)", connection->getInputChannelName().c_str()); Loading Loading @@ -3596,8 +3597,8 @@ const std::array<uint8_t, 32> InputDispatcher::getSignature( } void InputDispatcher::finishDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) { const std::shared_ptr<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) { if (DEBUG_DISPATCH_CYCLE) { ALOGD("channel '%s' ~ finishDispatchCycle - seq=%u, handled=%s", connection->getInputChannelName().c_str(), seq, toString(handled)); Loading @@ -3616,7 +3617,7 @@ void InputDispatcher::finishDispatchCycleLocked(nsecs_t currentTime, } void InputDispatcher::abortBrokenDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, const std::shared_ptr<Connection>& connection, bool notify) { if (DEBUG_DISPATCH_CYCLE) { LOG(DEBUG) << "channel '" << connection->getInputChannelName() << "'~ " << __func__ Loading Loading @@ -3665,7 +3666,7 @@ void InputDispatcher::releaseDispatchEntry(DispatchEntry* dispatchEntry) { int InputDispatcher::handleReceiveCallback(int events, sp<IBinder> connectionToken) { std::scoped_lock _l(mLock); sp<Connection> connection = getConnectionLocked(connectionToken); std::shared_ptr<Connection> connection = getConnectionLocked(connectionToken); if (connection == nullptr) { ALOGW("Received looper callback for unknown input channel token %p. events=0x%x", connectionToken.get(), events); Loading Loading @@ -3757,7 +3758,7 @@ void InputDispatcher::synthesizeCancelationEventsForMonitorsLocked( void InputDispatcher::synthesizeCancelationEventsForInputChannelLocked( const std::shared_ptr<InputChannel>& channel, const CancelationOptions& options) { sp<Connection> connection = getConnectionLocked(channel->getConnectionToken()); std::shared_ptr<Connection> connection = getConnectionLocked(channel->getConnectionToken()); if (connection == nullptr) { return; } Loading @@ -3766,7 +3767,7 @@ void InputDispatcher::synthesizeCancelationEventsForInputChannelLocked( } void InputDispatcher::synthesizeCancelationEventsForConnectionLocked( const sp<Connection>& connection, const CancelationOptions& options) { const std::shared_ptr<Connection>& connection, const CancelationOptions& options) { if (connection->status == Connection::Status::BROKEN) { return; } Loading Loading @@ -3844,7 +3845,7 @@ void InputDispatcher::synthesizeCancelationEventsForConnectionLocked( } void InputDispatcher::synthesizePointerDownEventsForConnectionLocked( const nsecs_t downTime, const sp<Connection>& connection, const nsecs_t downTime, const std::shared_ptr<Connection>& connection, ftl::Flags<InputTarget::Flags> targetFlags) { if (connection->status == Connection::Status::BROKEN) { return; Loading Loading @@ -3909,7 +3910,8 @@ void InputDispatcher::synthesizePointerDownEventsForConnectionLocked( void InputDispatcher::synthesizeCancelationEventsForWindowLocked( const sp<WindowInfoHandle>& windowHandle, const CancelationOptions& options) { if (windowHandle != nullptr) { sp<Connection> wallpaperConnection = getConnectionLocked(windowHandle->getToken()); std::shared_ptr<Connection> wallpaperConnection = getConnectionLocked(windowHandle->getToken()); if (wallpaperConnection != nullptr) { synthesizeCancelationEventsForConnectionLocked(wallpaperConnection, options); } Loading Loading @@ -4796,7 +4798,7 @@ bool InputDispatcher::canWindowReceiveMotionLocked(const sp<WindowInfoHandle>& w return false; } sp<Connection> connection = getConnectionLocked(window->getToken()); std::shared_ptr<Connection> connection = getConnectionLocked(window->getToken()); if (connection == nullptr) { ALOGW("Not sending touch to %s because there's no corresponding connection", window->getName().c_str()); Loading Loading @@ -5318,8 +5320,8 @@ bool InputDispatcher::transferTouchFocus(const sp<IBinder>& fromToken, const sp< } // Synthesize cancel for old window and down for new window. sp<Connection> fromConnection = getConnectionLocked(fromToken); sp<Connection> toConnection = getConnectionLocked(toToken); std::shared_ptr<Connection> fromConnection = getConnectionLocked(fromToken); std::shared_ptr<Connection> toConnection = getConnectionLocked(toToken); if (fromConnection != nullptr && toConnection != nullptr) { fromConnection->inputState.mergePointerStateTo(toConnection->inputState); CancelationOptions Loading Loading @@ -5685,8 +5687,9 @@ Result<std::unique_ptr<InputChannel>> InputDispatcher::createInputChannel(const std::scoped_lock _l(mLock); const sp<IBinder>& token = serverChannel->getConnectionToken(); int fd = serverChannel->getFd(); sp<Connection> connection = sp<Connection>::make(std::move(serverChannel), /*monitor=*/false, mIdGenerator); std::shared_ptr<Connection> connection = std::make_shared<Connection>(std::move(serverChannel), /*monitor=*/false, mIdGenerator); if (mConnectionsByToken.find(token) != mConnectionsByToken.end()) { ALOGE("Created a new connection, but the token %p is already known", token.get()); Loading Loading @@ -5723,8 +5726,8 @@ Result<std::unique_ptr<InputChannel>> InputDispatcher::createInputMonitor(int32_ << " without a specified display."; } sp<Connection> connection = sp<Connection>::make(serverChannel, /*monitor=*/true, mIdGenerator); std::shared_ptr<Connection> connection = std::make_shared<Connection>(serverChannel, /*monitor=*/true, mIdGenerator); const sp<IBinder>& token = serverChannel->getConnectionToken(); const int fd = serverChannel->getFd(); Loading Loading @@ -5764,7 +5767,7 @@ status_t InputDispatcher::removeInputChannel(const sp<IBinder>& connectionToken) status_t InputDispatcher::removeInputChannelLocked(const sp<IBinder>& connectionToken, bool notify) { sp<Connection> connection = getConnectionLocked(connectionToken); std::shared_ptr<Connection> connection = getConnectionLocked(connectionToken); if (connection == nullptr) { // Connection can be removed via socket hang up or an explicit call to 'removeInputChannel' return BAD_VALUE; Loading Loading @@ -5910,7 +5913,8 @@ std::optional<int32_t> InputDispatcher::findMonitorPidByTokenLocked(const sp<IBi return std::nullopt; } sp<Connection> InputDispatcher::getConnectionLocked(const sp<IBinder>& inputConnectionToken) const { std::shared_ptr<Connection> InputDispatcher::getConnectionLocked( const sp<IBinder>& inputConnectionToken) const { if (inputConnectionToken == nullptr) { return nullptr; } Loading @@ -5925,21 +5929,22 @@ sp<Connection> InputDispatcher::getConnectionLocked(const sp<IBinder>& inputConn } std::string InputDispatcher::getConnectionNameLocked(const sp<IBinder>& connectionToken) const { sp<Connection> connection = getConnectionLocked(connectionToken); std::shared_ptr<Connection> connection = getConnectionLocked(connectionToken); if (connection == nullptr) { return "<nullptr>"; } return connection->getInputChannelName(); } void InputDispatcher::removeConnectionLocked(const sp<Connection>& connection) { void InputDispatcher::removeConnectionLocked(const std::shared_ptr<Connection>& connection) { mAnrTracker.eraseToken(connection->inputChannel->getConnectionToken()); mConnectionsByToken.erase(connection->inputChannel->getConnectionToken()); } void InputDispatcher::doDispatchCycleFinishedCommand(nsecs_t finishTime, const sp<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) { const std::shared_ptr<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) { // Handle post-event policy actions. std::deque<DispatchEntry*>::iterator dispatchEntryIt = connection->findWaitQueueEntry(seq); if (dispatchEntryIt == connection->waitQueue.end()) { Loading Loading @@ -6017,7 +6022,7 @@ void InputDispatcher::sendDropWindowCommandLocked(const sp<IBinder>& token, floa postCommandLocked(std::move(command)); } void InputDispatcher::onAnrLocked(const sp<Connection>& connection) { void InputDispatcher::onAnrLocked(const std::shared_ptr<Connection>& connection) { if (connection == nullptr) { LOG_ALWAYS_FATAL("Caller must check for nullness"); } Loading Loading @@ -6179,8 +6184,8 @@ void InputDispatcher::processConnectionResponsiveLocked(const Connection& connec sendWindowResponsiveCommandLocked(connectionToken, pid); } bool InputDispatcher::afterKeyEventLockedInterruptable(const sp<Connection>& connection, DispatchEntry* dispatchEntry, bool InputDispatcher::afterKeyEventLockedInterruptable( const std::shared_ptr<Connection>& connection, DispatchEntry* dispatchEntry, KeyEntry& keyEntry, bool handled) { if (keyEntry.flags & AKEY_EVENT_FLAG_FALLBACK) { if (!handled) { Loading Loading @@ -6356,8 +6361,8 @@ bool InputDispatcher::afterKeyEventLockedInterruptable(const sp<Connection>& con return false; } bool InputDispatcher::afterMotionEventLockedInterruptable(const sp<Connection>& connection, DispatchEntry* dispatchEntry, bool InputDispatcher::afterMotionEventLockedInterruptable( const std::shared_ptr<Connection>& connection, DispatchEntry* dispatchEntry, MotionEntry& motionEntry, bool handled) { return false; } Loading Loading @@ -6680,9 +6685,11 @@ void InputDispatcher::transferWallpaperTouch(ftl::Flags<InputTarget::Flags> oldT wallpaperFlags |= InputTarget::Flags::WINDOW_IS_OBSCURED | InputTarget::Flags::WINDOW_IS_PARTIALLY_OBSCURED; state.addOrUpdateWindow(newWallpaper, wallpaperFlags, pointerIds, downTimeInTarget); sp<Connection> wallpaperConnection = getConnectionLocked(newWallpaper->getToken()); std::shared_ptr<Connection> wallpaperConnection = getConnectionLocked(newWallpaper->getToken()); if (wallpaperConnection != nullptr) { sp<Connection> toConnection = getConnectionLocked(toWindowHandle->getToken()); std::shared_ptr<Connection> toConnection = getConnectionLocked(toWindowHandle->getToken()); toConnection->inputState.mergePointerStateTo(wallpaperConnection->inputState); synthesizePointerDownEventsForConnectionLocked(downTimeInTarget, wallpaperConnection, wallpaperFlags); Loading
services/inputflinger/dispatcher/InputDispatcher.h +31 −28 Original line number Diff line number Diff line Loading @@ -249,12 +249,12 @@ private: sp<android::gui::WindowInfoHandle> findTouchedForegroundWindowLocked(int32_t displayId) const REQUIRES(mLock); sp<Connection> getConnectionLocked(const sp<IBinder>& inputConnectionToken) const std::shared_ptr<Connection> getConnectionLocked(const sp<IBinder>& inputConnectionToken) const REQUIRES(mLock); std::string getConnectionNameLocked(const sp<IBinder>& connectionToken) const REQUIRES(mLock); void removeConnectionLocked(const sp<Connection>& connection) REQUIRES(mLock); void removeConnectionLocked(const std::shared_ptr<Connection>& connection) REQUIRES(mLock); status_t pilferPointersLocked(const sp<IBinder>& token) REQUIRES(mLock); Loading @@ -264,8 +264,8 @@ private: }; // All registered connections mapped by input channel token. std::unordered_map<sp<IBinder>, sp<Connection>, StrongPointerHash<IBinder>> mConnectionsByToken GUARDED_BY(mLock); std::unordered_map<sp<IBinder>, std::shared_ptr<Connection>, StrongPointerHash<IBinder>> mConnectionsByToken GUARDED_BY(mLock); // Find a monitor pid by the provided token. std::optional<int32_t> findMonitorPidByTokenLocked(const sp<IBinder>& token) REQUIRES(mLock); Loading Loading @@ -328,8 +328,8 @@ private: std::chrono::nanoseconds mMonitorDispatchingTimeout GUARDED_BY(mLock); nsecs_t processAnrsLocked() REQUIRES(mLock); std::chrono::nanoseconds getDispatchingTimeoutLocked(const sp<Connection>& connection) REQUIRES(mLock); std::chrono::nanoseconds getDispatchingTimeoutLocked( const std::shared_ptr<Connection>& connection) REQUIRES(mLock); // Input filter processing. bool shouldSendKeyToInputFilterLocked(const NotifyKeyArgs& args) REQUIRES(mLock); Loading Loading @@ -533,7 +533,7 @@ private: // prevent unneeded wakeups. AnrTracker mAnrTracker GUARDED_BY(mLock); void cancelEventsForAnrLocked(const sp<Connection>& connection) REQUIRES(mLock); void cancelEventsForAnrLocked(const std::shared_ptr<Connection>& connection) REQUIRES(mLock); // If a focused application changes, we should stop counting down the "no focused window" time, // because we will have no way of knowing when the previous application actually added a window. // This also means that we will miss cases like pulling down notification shade when the Loading Loading @@ -594,22 +594,26 @@ private: // These methods are deliberately not Interruptible because doing all of the work // with the mutex held makes it easier to ensure that connection invariants are maintained. // If needed, the methods post commands to run later once the critical bits are done. void prepareDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, void prepareDispatchCycleLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry>, const InputTarget& inputTarget) REQUIRES(mLock); void enqueueDispatchEntriesLocked(nsecs_t currentTime, const sp<Connection>& connection, void enqueueDispatchEntriesLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry>, const InputTarget& inputTarget) REQUIRES(mLock); void enqueueDispatchEntryLocked(const sp<Connection>& connection, std::shared_ptr<EventEntry>, const InputTarget& inputTarget, void enqueueDispatchEntryLocked(const std::shared_ptr<Connection>& connection, std::shared_ptr<EventEntry>, const InputTarget& inputTarget, ftl::Flags<InputTarget::Flags> dispatchMode) REQUIRES(mLock); status_t publishMotionEvent(Connection& connection, DispatchEntry& dispatchEntry) const; void startDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection) void startDispatchCycleLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection) REQUIRES(mLock); void finishDispatchCycleLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) REQUIRES(mLock); void abortBrokenDispatchCycleLocked(nsecs_t currentTime, const std::shared_ptr<Connection>& connection, bool notify) REQUIRES(mLock); void finishDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) REQUIRES(mLock); void abortBrokenDispatchCycleLocked(nsecs_t currentTime, const sp<Connection>& connection, bool notify) REQUIRES(mLock); void drainDispatchQueue(std::deque<DispatchEntry*>& queue); void releaseDispatchEntry(DispatchEntry* dispatchEntry); int handleReceiveCallback(int events, sp<IBinder> connectionToken); Loading @@ -624,14 +628,13 @@ private: void synthesizeCancelationEventsForInputChannelLocked( const std::shared_ptr<InputChannel>& channel, const CancelationOptions& options) REQUIRES(mLock); void synthesizeCancelationEventsForConnectionLocked(const sp<Connection>& connection, const CancelationOptions& options) void synthesizeCancelationEventsForConnectionLocked( const std::shared_ptr<Connection>& connection, const CancelationOptions& options) REQUIRES(mLock); void synthesizePointerDownEventsForConnectionLocked(const nsecs_t downTime, const sp<Connection>& connection, ftl::Flags<InputTarget::Flags> targetFlags) REQUIRES(mLock); void synthesizePointerDownEventsForConnectionLocked( const nsecs_t downTime, const std::shared_ptr<Connection>& connection, ftl::Flags<InputTarget::Flags> targetFlags) REQUIRES(mLock); void synthesizeCancelationEventsForWindowLocked( const sp<android::gui::WindowInfoHandle>& windowHandle, Loading @@ -658,16 +661,16 @@ private: REQUIRES(mLock); // Interesting events that we might like to log or tell the framework about. void doDispatchCycleFinishedCommand(nsecs_t finishTime, const sp<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) REQUIRES(mLock); void doDispatchCycleFinishedCommand(nsecs_t finishTime, const std::shared_ptr<Connection>& connection, uint32_t seq, bool handled, nsecs_t consumeTime) REQUIRES(mLock); void doInterceptKeyBeforeDispatchingCommand(const sp<IBinder>& focusedWindowToken, KeyEntry& entry) REQUIRES(mLock); void onFocusChangedLocked(const FocusResolver::FocusChanges& changes) REQUIRES(mLock); void sendFocusChangedCommandLocked(const sp<IBinder>& oldToken, const sp<IBinder>& newToken) REQUIRES(mLock); void sendDropWindowCommandLocked(const sp<IBinder>& token, float x, float y) REQUIRES(mLock); void onAnrLocked(const sp<Connection>& connection) REQUIRES(mLock); void onAnrLocked(const std::shared_ptr<Connection>& connection) REQUIRES(mLock); void onAnrLocked(std::shared_ptr<InputApplicationHandle> application) REQUIRES(mLock); void updateLastAnrStateLocked(const sp<android::gui::WindowInfoHandle>& window, const std::string& reason) REQUIRES(mLock); Loading @@ -675,10 +678,10 @@ private: const std::string& reason) REQUIRES(mLock); void updateLastAnrStateLocked(const std::string& windowLabel, const std::string& reason) REQUIRES(mLock); bool afterKeyEventLockedInterruptable(const sp<Connection>& connection, bool afterKeyEventLockedInterruptable(const std::shared_ptr<Connection>& connection, DispatchEntry* dispatchEntry, KeyEntry& keyEntry, bool handled) REQUIRES(mLock); bool afterMotionEventLockedInterruptable(const sp<Connection>& connection, bool afterMotionEventLockedInterruptable(const std::shared_ptr<Connection>& connection, DispatchEntry* dispatchEntry, MotionEntry& motionEntry, bool handled) REQUIRES(mLock); Loading