diff options
author | 2024-01-09 08:57:13 -0800 | |
---|---|---|
committer | 2024-01-09 18:34:01 -0800 | |
commit | aeed0da5878b59b42a9e9e40e48f36809bb315cb (patch) | |
tree | d6588c20b8ccb1528a7a6781c30d4ca613426801 /libs/gui/WindowInfo.cpp | |
parent | 5704dbd9a4ecd55af96eaf840852fdcb728cca4d (diff) |
Check for redundant windows inside WindowInfos
Recently, our team has seen traces where dispatcher is taking a long
time to run - sometimes, more than 22 milliseconds. That's way longer
than the expected ~ 0.3 milliseconds for the entire inputflinger.
After examining the traces, I noticed that there's a lot of time spent
in both findTouchedWindowTargets and dispatchInputEvent. It appears that
we are trying to dispatch one input event multiple times to the same
channel, dreamOverlay.
One way this could be possible if we receive multiple, redundant windows.
In this CL, we add a crash to identify and get out of this bad state.
Bug: 311142655
Test: TEST=inputflinger_tests; m $TEST && $ANDROID_HOST_OUT/nativetest64/$TEST/$TEST
Change-Id: I2170928d1bb1e591b9c93b42dd86827e86a0c7fb
Diffstat (limited to 'libs/gui/WindowInfo.cpp')
-rw-r--r-- | libs/gui/WindowInfo.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/gui/WindowInfo.cpp b/libs/gui/WindowInfo.cpp index ba1d196e9c..95b2641f04 100644 --- a/libs/gui/WindowInfo.cpp +++ b/libs/gui/WindowInfo.cpp @@ -258,8 +258,7 @@ void WindowInfoHandle::updateFrom(sp<WindowInfoHandle> handle) { mInfo = handle->mInfo; } -std::ostream& operator<<(std::ostream& out, const WindowInfoHandle& window) { - const WindowInfo& info = *window.getInfo(); +std::ostream& operator<<(std::ostream& out, const WindowInfo& info) { std::string transform; info.transform.dump(transform, "transform", " "); out << "name=" << info.name << ", id=" << info.id << ", displayId=" << info.displayId @@ -277,4 +276,10 @@ std::ostream& operator<<(std::ostream& out, const WindowInfoHandle& window) { return out; } +std::ostream& operator<<(std::ostream& out, const WindowInfoHandle& window) { + const WindowInfo& info = *window.getInfo(); + out << info; + return out; +} + } // namespace android::gui |