Trigger windowinfo updates when alpha changes
Input and TrustedPresentationListener logic relies on layer alpha. This change ensures
that SurfaceFlinger sends the updated window info when only the alpha changes.
Fixes: 325254898
Test: presubmit
Flag: EXEMPT bugfix
Change-Id: I6b9a5b2874add278245cb682c5362c18403c70b0
diff --git a/services/surfaceflinger/tests/unittests/LayerSnapshotTest.cpp b/services/surfaceflinger/tests/unittests/LayerSnapshotTest.cpp
index bd0accd..8cf3f03 100644
--- a/services/surfaceflinger/tests/unittests/LayerSnapshotTest.cpp
+++ b/services/surfaceflinger/tests/unittests/LayerSnapshotTest.cpp
@@ -1161,6 +1161,16 @@
gui::WindowInfo::InputConfig::TRUSTED_OVERLAY));
}
+TEST_F(LayerSnapshotTest, alphaChangesPropagateToInput) {
+ Region touch{Rect{0, 0, 1000, 1000}};
+ setTouchableRegion(1, touch);
+ UPDATE_AND_VERIFY(mSnapshotBuilder, STARTING_ZORDER);
+
+ setAlpha(1, 0.5f);
+ UPDATE_AND_VERIFY(mSnapshotBuilder, STARTING_ZORDER);
+ EXPECT_EQ(getSnapshot(1)->inputInfo.alpha, 0.5f);
+}
+
TEST_F(LayerSnapshotTest, isFrontBuffered) {
setBuffer(1,
std::make_shared<renderengine::mock::FakeExternalTexture>(