diff options
author | Patrick Williams <pdwilliams@google.com> | 2023-05-23 11:22:04 -0500 |
---|---|---|
committer | Patrick Williams <pdwilliams@google.com> | 2023-05-25 11:43:55 -0500 |
commit | 9464b2cc5c9789eacd0b14a3754660df28a89e7f (patch) | |
tree | 66168f3160c78d2dbc38ce02e3294882b0d96e5f | |
parent | 01b8e815f1a73b376022cf72607ea235d52bd6ef (diff) | |
download | native-9464b2cc5c9789eacd0b14a3754660df28a89e7f.tar.gz |
Log out-of-order window infos updates
We're not aware of any condition that would lead this to happen. This
check is to help provide information in case we see future input windows
syncronization issues.
Bug: 279792237
Test: presubmits
Change-Id: I9bdcf34c71c1a741f863feb0881cd09122c7bfb2
-rw-r--r-- | services/inputflinger/dispatcher/InputDispatcher.cpp | 7 | ||||
-rw-r--r-- | services/inputflinger/dispatcher/InputDispatcher.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp index 0cc7cfbcc8..fbbb38835a 100644 --- a/services/inputflinger/dispatcher/InputDispatcher.cpp +++ b/services/inputflinger/dispatcher/InputDispatcher.cpp @@ -6700,6 +6700,13 @@ void InputDispatcher::onWindowInfosChanged(const gui::WindowInfosUpdate& update) for (const auto& [displayId, handles] : handlesPerDisplay) { setInputWindowsLocked(handles, displayId); } + + if (update.vsyncId < mWindowInfosVsyncId) { + ALOGE("Received out of order window infos update. Last update vsync id: %" PRId64 + ", current update vsync id: %" PRId64, + mWindowInfosVsyncId, update.vsyncId); + } + mWindowInfosVsyncId = update.vsyncId; } // Wake up poll loop since it may need to make new input dispatching choices. mLooper->wake(); diff --git a/services/inputflinger/dispatcher/InputDispatcher.h b/services/inputflinger/dispatcher/InputDispatcher.h index 8ca01b7a09..6b22f2f24f 100644 --- a/services/inputflinger/dispatcher/InputDispatcher.h +++ b/services/inputflinger/dispatcher/InputDispatcher.h @@ -204,6 +204,8 @@ private: const IdGenerator mIdGenerator; + int64_t mWindowInfosVsyncId GUARDED_BY(mLock); + // With each iteration, InputDispatcher nominally processes one queued event, // a timeout, or a response from an input consumer. // This method should only be called on the input dispatcher's own thread. |