SF: Enforce that layers with invalid input bounds are not focusable
Bug: 162194035
Test: atest libgui_test
Change-Id: Ic561e8b3e52faae28888ef3d323583e09aa278c0
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 5175be9..8c77a8b 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -2170,6 +2170,7 @@
Rect layerBounds = getInputBounds();
if (!layerBounds.isValid()) {
info.flags = WindowInfo::Flag::NOT_TOUCH_MODAL | WindowInfo::Flag::NOT_FOCUSABLE;
+ info.focusable = false;
info.touchableRegion.clear();
// A layer could have invalid input bounds and still expect to receive touch input if it has
// replaceTouchableRegionWithCrop. For that case, the input transform needs to be calculated