Fix the input info missing for SurfaceView
Layer snapshots with buffers but without inputinfo were not sent to input or other window info listeners. This was due to a bug in how we checked to see if the layer needed an input info. FIx this to send SurfaceView layers to window info listeners.
Fixes: 365167765
Test: LayerSnapshotTest
Test: LayerLifecycleManagerTest
Flag: EXEMPT bugfix
Change-Id: I49e5d1e503af860a8324cc8b36589748ca2b7a25
diff --git a/services/surfaceflinger/tests/unittests/LayerLifecycleManagerTest.cpp b/services/surfaceflinger/tests/unittests/LayerLifecycleManagerTest.cpp
index b4efe0f..c7cc21c 100644
--- a/services/surfaceflinger/tests/unittests/LayerLifecycleManagerTest.cpp
+++ b/services/surfaceflinger/tests/unittests/LayerLifecycleManagerTest.cpp
@@ -619,4 +619,14 @@
}
}
+TEST_F(LayerLifecycleManagerTest, testInputInfoOfRequestedLayerState) {
+ // By default the layer has no buffer, so it doesn't need an input info
+ EXPECT_FALSE(getRequestedLayerState(mLifecycleManager, 111)->needsInputInfo());
+
+ setBuffer(111);
+ mLifecycleManager.commitChanges();
+
+ EXPECT_TRUE(getRequestedLayerState(mLifecycleManager, 111)->needsInputInfo());
+}
+
} // namespace android::surfaceflinger::frontend