Trace input only if the layer needs an input info
It should skip trace the input if the layer don't need an input info.
Or the 'fillInputInfo' would automatically fill the info if the layer
would be checked in input.
Bug: 227316706
Test: enabled winscope, enabled one hand mode.
Change-Id: I64a3d6328e283d057c528ffda6af3b21cfaf44ee
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index f7e1d1e..d8a5601 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2185,7 +2185,7 @@
layerInfo->set_owner_uid(mOwnerUid);
- if (traceFlags & LayerTracing::TRACE_INPUT) {
+ if ((traceFlags & LayerTracing::TRACE_INPUT) && needsInputInfo()) {
WindowInfo info;
if (useDrawing) {
info = fillInputInfo(ui::Transform(), /* displayIsSecure */ true);