Loading services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,8 @@ private: void setPointerCapture(bool enabled) override {} void notifyDropWindow(const sp<IBinder>&, float x, float y) override {} InputDispatcherConfiguration mConfig; }; Loading services/inputflinger/dispatcher/Entry.h +2 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,8 @@ struct CommandEntry { int32_t pid; nsecs_t consumeTime; // time when the event was consumed by InputConsumer int32_t displayId; float x; float y; }; } // namespace android::inputdispatcher Loading services/inputflinger/dispatcher/InputDispatcher.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -2345,6 +2345,10 @@ void InputDispatcher::addDragEventLocked(const MotionEntry& entry, TouchState& s } } else if (maskedAction == AMOTION_EVENT_ACTION_UP || maskedAction == AMOTION_EVENT_ACTION_CANCEL) { if (state.dragHoverWindowHandle && maskedAction == AMOTION_EVENT_ACTION_UP) { vec2 local = state.dragHoverWindowHandle->getInfo()->transform.transform(x, y); notifyDropWindowLocked(state.dragHoverWindowHandle->getToken(), local.x, local.y); } state.dragWindow = nullptr; state.dragHoverWindowHandle = nullptr; } Loading Loading @@ -5302,6 +5306,15 @@ void InputDispatcher::notifyFocusChangedLocked(const sp<IBinder>& oldToken, postCommandLocked(std::move(commandEntry)); } void InputDispatcher::notifyDropWindowLocked(const sp<IBinder>& token, float x, float y) { std::unique_ptr<CommandEntry> commandEntry = std::make_unique<CommandEntry>(&InputDispatcher::doNotifyDropWindowLockedInterruptible); commandEntry->newToken = token; commandEntry->x = x; commandEntry->y = y; postCommandLocked(std::move(commandEntry)); } void InputDispatcher::onAnrLocked(const sp<Connection>& connection) { if (connection == nullptr) { LOG_ALWAYS_FATAL("Caller must check for nullness"); Loading Loading @@ -5411,6 +5424,13 @@ void InputDispatcher::doNotifyFocusChangedLockedInterruptible(CommandEntry* comm mLock.lock(); } void InputDispatcher::doNotifyDropWindowLockedInterruptible(CommandEntry* commandEntry) { sp<IBinder> newToken = commandEntry->newToken; mLock.unlock(); mPolicy->notifyDropWindow(newToken, commandEntry->x, commandEntry->y); mLock.lock(); } void InputDispatcher::doNotifyNoFocusedWindowAnrLockedInterruptible(CommandEntry* commandEntry) { mLock.unlock(); Loading services/inputflinger/dispatcher/InputDispatcher.h +3 −0 Original line number Diff line number Diff line Loading @@ -592,6 +592,7 @@ private: void onFocusChangedLocked(const FocusResolver::FocusChanges& changes) REQUIRES(mLock); void notifyFocusChangedLocked(const sp<IBinder>& oldFocus, const sp<IBinder>& newFocus) REQUIRES(mLock); void notifyDropWindowLocked(const sp<IBinder>& token, float x, float y) REQUIRES(mLock); void onAnrLocked(const sp<Connection>& connection) REQUIRES(mLock); void onAnrLocked(std::shared_ptr<InputApplicationHandle> application) REQUIRES(mLock); void onUntrustedTouchLocked(const std::string& obscuringPackage) REQUIRES(mLock); Loading @@ -607,6 +608,8 @@ private: REQUIRES(mLock); void doNotifyInputChannelBrokenLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); void doNotifyFocusChangedLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); void doNotifyDropWindowLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); // ANR-related callbacks - start void doNotifyNoFocusedWindowAnrLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); void doNotifyWindowUnresponsiveLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); Loading services/inputflinger/dispatcher/include/InputDispatcherPolicyInterface.h +3 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,9 @@ public: * InputDispatcher is solely responsible for updating the Pointer Capture state. */ virtual void setPointerCapture(bool enabled) = 0; /* Notifies the policy that the drag window has moved over to another window */ virtual void notifyDropWindow(const sp<IBinder>& token, float x, float y) = 0; }; } // namespace android Loading Loading
services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -113,6 +113,8 @@ private: void setPointerCapture(bool enabled) override {} void notifyDropWindow(const sp<IBinder>&, float x, float y) override {} InputDispatcherConfiguration mConfig; }; Loading
services/inputflinger/dispatcher/Entry.h +2 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,8 @@ struct CommandEntry { int32_t pid; nsecs_t consumeTime; // time when the event was consumed by InputConsumer int32_t displayId; float x; float y; }; } // namespace android::inputdispatcher Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +20 −0 Original line number Diff line number Diff line Loading @@ -2345,6 +2345,10 @@ void InputDispatcher::addDragEventLocked(const MotionEntry& entry, TouchState& s } } else if (maskedAction == AMOTION_EVENT_ACTION_UP || maskedAction == AMOTION_EVENT_ACTION_CANCEL) { if (state.dragHoverWindowHandle && maskedAction == AMOTION_EVENT_ACTION_UP) { vec2 local = state.dragHoverWindowHandle->getInfo()->transform.transform(x, y); notifyDropWindowLocked(state.dragHoverWindowHandle->getToken(), local.x, local.y); } state.dragWindow = nullptr; state.dragHoverWindowHandle = nullptr; } Loading Loading @@ -5302,6 +5306,15 @@ void InputDispatcher::notifyFocusChangedLocked(const sp<IBinder>& oldToken, postCommandLocked(std::move(commandEntry)); } void InputDispatcher::notifyDropWindowLocked(const sp<IBinder>& token, float x, float y) { std::unique_ptr<CommandEntry> commandEntry = std::make_unique<CommandEntry>(&InputDispatcher::doNotifyDropWindowLockedInterruptible); commandEntry->newToken = token; commandEntry->x = x; commandEntry->y = y; postCommandLocked(std::move(commandEntry)); } void InputDispatcher::onAnrLocked(const sp<Connection>& connection) { if (connection == nullptr) { LOG_ALWAYS_FATAL("Caller must check for nullness"); Loading Loading @@ -5411,6 +5424,13 @@ void InputDispatcher::doNotifyFocusChangedLockedInterruptible(CommandEntry* comm mLock.lock(); } void InputDispatcher::doNotifyDropWindowLockedInterruptible(CommandEntry* commandEntry) { sp<IBinder> newToken = commandEntry->newToken; mLock.unlock(); mPolicy->notifyDropWindow(newToken, commandEntry->x, commandEntry->y); mLock.lock(); } void InputDispatcher::doNotifyNoFocusedWindowAnrLockedInterruptible(CommandEntry* commandEntry) { mLock.unlock(); Loading
services/inputflinger/dispatcher/InputDispatcher.h +3 −0 Original line number Diff line number Diff line Loading @@ -592,6 +592,7 @@ private: void onFocusChangedLocked(const FocusResolver::FocusChanges& changes) REQUIRES(mLock); void notifyFocusChangedLocked(const sp<IBinder>& oldFocus, const sp<IBinder>& newFocus) REQUIRES(mLock); void notifyDropWindowLocked(const sp<IBinder>& token, float x, float y) REQUIRES(mLock); void onAnrLocked(const sp<Connection>& connection) REQUIRES(mLock); void onAnrLocked(std::shared_ptr<InputApplicationHandle> application) REQUIRES(mLock); void onUntrustedTouchLocked(const std::string& obscuringPackage) REQUIRES(mLock); Loading @@ -607,6 +608,8 @@ private: REQUIRES(mLock); void doNotifyInputChannelBrokenLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); void doNotifyFocusChangedLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); void doNotifyDropWindowLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); // ANR-related callbacks - start void doNotifyNoFocusedWindowAnrLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); void doNotifyWindowUnresponsiveLockedInterruptible(CommandEntry* commandEntry) REQUIRES(mLock); Loading
services/inputflinger/dispatcher/include/InputDispatcherPolicyInterface.h +3 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,9 @@ public: * InputDispatcher is solely responsible for updating the Pointer Capture state. */ virtual void setPointerCapture(bool enabled) = 0; /* Notifies the policy that the drag window has moved over to another window */ virtual void notifyDropWindow(const sp<IBinder>& token, float x, float y) = 0; }; } // namespace android Loading