Loading services/inputflinger/InputDispatcher.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -3175,7 +3175,7 @@ void InputDispatcher::setInputWindows(const Vector<sp<InputWindowHandle>>& input } if (mFocusedDisplayId == displayId) { onFocusChangedLocked(newFocusedWindowHandle); onFocusChangedLocked(oldFocusedWindowHandle, newFocusedWindowHandle); } } Loading Loading @@ -3293,7 +3293,7 @@ void InputDispatcher::setFocusedDisplay(int32_t displayId) { // Sanity check sp<InputWindowHandle> newFocusedWindowHandle = getValueByKey(mFocusedWindowHandlesByDisplay, displayId); onFocusChangedLocked(newFocusedWindowHandle); onFocusChangedLocked(oldFocusedWindowHandle, newFocusedWindowHandle); if (newFocusedWindowHandle == nullptr) { ALOGW("Focused display #%" PRId32 " does not have a focused window.", displayId); Loading Loading @@ -3855,11 +3855,14 @@ void InputDispatcher::onDispatchCycleBrokenLocked( commandEntry->connection = connection; } void InputDispatcher::onFocusChangedLocked(const sp<InputWindowHandle>& newFocus) { sp<IBinder> token = newFocus != nullptr ? newFocus->getToken() : nullptr; void InputDispatcher::onFocusChangedLocked(const sp<InputWindowHandle>& oldFocus, const sp<InputWindowHandle>& newFocus) { sp<IBinder> oldToken = oldFocus != nullptr ? oldFocus->getToken() : nullptr; sp<IBinder> newToken = newFocus != nullptr ? newFocus->getToken() : nullptr; CommandEntry* commandEntry = postCommandLocked( & InputDispatcher::doNotifyFocusChangedLockedInterruptible); commandEntry->token = token; commandEntry->oldToken = oldToken; commandEntry->newToken = newToken; } void InputDispatcher::onANRLocked( Loading Loading @@ -3921,9 +3924,10 @@ void InputDispatcher::doNotifyInputChannelBrokenLockedInterruptible( void InputDispatcher::doNotifyFocusChangedLockedInterruptible( CommandEntry* commandEntry) { sp<IBinder> token = commandEntry->token; sp<IBinder> oldToken = commandEntry->oldToken; sp<IBinder> newToken = commandEntry->newToken; mLock.unlock(); mPolicy->notifyFocusChanged(token); mPolicy->notifyFocusChanged(oldToken, newToken); mLock.lock(); } Loading services/inputflinger/InputDispatcher.h +5 −3 Original line number Diff line number Diff line Loading @@ -217,7 +217,7 @@ public: /* Notifies the system that an input channel is unrecoverably broken. */ virtual void notifyInputChannelBroken(const sp<IBinder>& token) = 0; virtual void notifyFocusChanged(const sp<IBinder>& token) = 0; virtual void notifyFocusChanged(const sp<IBinder>& oldToken, const sp<IBinder>& newToken) = 0; /* Gets the input dispatcher configuration. */ virtual void getDispatcherConfiguration(InputDispatcherConfiguration* outConfig) = 0; Loading Loading @@ -628,7 +628,8 @@ private: uint32_t seq; bool handled; sp<InputChannel> inputChannel; sp<IBinder> token; sp<IBinder> oldToken; sp<IBinder> newToken; }; // Generic queue implementation. Loading Loading @@ -1158,7 +1159,8 @@ private: nsecs_t currentTime, const sp<Connection>& connection, uint32_t seq, bool handled); void onDispatchCycleBrokenLocked( nsecs_t currentTime, const sp<Connection>& connection); void onFocusChangedLocked(const sp<InputWindowHandle>& newFocus); void onFocusChangedLocked(const sp<InputWindowHandle>& oldFocus, const sp<InputWindowHandle>& newFocus); void onANRLocked( nsecs_t currentTime, const sp<InputApplicationHandle>& applicationHandle, const sp<InputWindowHandle>& windowHandle, Loading services/inputflinger/tests/InputDispatcher_test.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ private: virtual void notifyInputChannelBroken(const sp<IBinder>&) { } virtual void notifyFocusChanged(const sp<IBinder>&) { virtual void notifyFocusChanged(const sp<IBinder>&, const sp<IBinder>&) { } virtual void getDispatcherConfiguration(InputDispatcherConfiguration* outConfig) { Loading Loading
services/inputflinger/InputDispatcher.cpp +11 −7 Original line number Diff line number Diff line Loading @@ -3175,7 +3175,7 @@ void InputDispatcher::setInputWindows(const Vector<sp<InputWindowHandle>>& input } if (mFocusedDisplayId == displayId) { onFocusChangedLocked(newFocusedWindowHandle); onFocusChangedLocked(oldFocusedWindowHandle, newFocusedWindowHandle); } } Loading Loading @@ -3293,7 +3293,7 @@ void InputDispatcher::setFocusedDisplay(int32_t displayId) { // Sanity check sp<InputWindowHandle> newFocusedWindowHandle = getValueByKey(mFocusedWindowHandlesByDisplay, displayId); onFocusChangedLocked(newFocusedWindowHandle); onFocusChangedLocked(oldFocusedWindowHandle, newFocusedWindowHandle); if (newFocusedWindowHandle == nullptr) { ALOGW("Focused display #%" PRId32 " does not have a focused window.", displayId); Loading Loading @@ -3855,11 +3855,14 @@ void InputDispatcher::onDispatchCycleBrokenLocked( commandEntry->connection = connection; } void InputDispatcher::onFocusChangedLocked(const sp<InputWindowHandle>& newFocus) { sp<IBinder> token = newFocus != nullptr ? newFocus->getToken() : nullptr; void InputDispatcher::onFocusChangedLocked(const sp<InputWindowHandle>& oldFocus, const sp<InputWindowHandle>& newFocus) { sp<IBinder> oldToken = oldFocus != nullptr ? oldFocus->getToken() : nullptr; sp<IBinder> newToken = newFocus != nullptr ? newFocus->getToken() : nullptr; CommandEntry* commandEntry = postCommandLocked( & InputDispatcher::doNotifyFocusChangedLockedInterruptible); commandEntry->token = token; commandEntry->oldToken = oldToken; commandEntry->newToken = newToken; } void InputDispatcher::onANRLocked( Loading Loading @@ -3921,9 +3924,10 @@ void InputDispatcher::doNotifyInputChannelBrokenLockedInterruptible( void InputDispatcher::doNotifyFocusChangedLockedInterruptible( CommandEntry* commandEntry) { sp<IBinder> token = commandEntry->token; sp<IBinder> oldToken = commandEntry->oldToken; sp<IBinder> newToken = commandEntry->newToken; mLock.unlock(); mPolicy->notifyFocusChanged(token); mPolicy->notifyFocusChanged(oldToken, newToken); mLock.lock(); } Loading
services/inputflinger/InputDispatcher.h +5 −3 Original line number Diff line number Diff line Loading @@ -217,7 +217,7 @@ public: /* Notifies the system that an input channel is unrecoverably broken. */ virtual void notifyInputChannelBroken(const sp<IBinder>& token) = 0; virtual void notifyFocusChanged(const sp<IBinder>& token) = 0; virtual void notifyFocusChanged(const sp<IBinder>& oldToken, const sp<IBinder>& newToken) = 0; /* Gets the input dispatcher configuration. */ virtual void getDispatcherConfiguration(InputDispatcherConfiguration* outConfig) = 0; Loading Loading @@ -628,7 +628,8 @@ private: uint32_t seq; bool handled; sp<InputChannel> inputChannel; sp<IBinder> token; sp<IBinder> oldToken; sp<IBinder> newToken; }; // Generic queue implementation. Loading Loading @@ -1158,7 +1159,8 @@ private: nsecs_t currentTime, const sp<Connection>& connection, uint32_t seq, bool handled); void onDispatchCycleBrokenLocked( nsecs_t currentTime, const sp<Connection>& connection); void onFocusChangedLocked(const sp<InputWindowHandle>& newFocus); void onFocusChangedLocked(const sp<InputWindowHandle>& oldFocus, const sp<InputWindowHandle>& newFocus); void onANRLocked( nsecs_t currentTime, const sp<InputApplicationHandle>& applicationHandle, const sp<InputWindowHandle>& windowHandle, Loading
services/inputflinger/tests/InputDispatcher_test.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ private: virtual void notifyInputChannelBroken(const sp<IBinder>&) { } virtual void notifyFocusChanged(const sp<IBinder>&) { virtual void notifyFocusChanged(const sp<IBinder>&, const sp<IBinder>&) { } virtual void getDispatcherConfiguration(InputDispatcherConfiguration* outConfig) { Loading