diff options
| -rw-r--r-- | libs/gui/tests/EndToEndNativeInputTest.cpp | 14 | ||||
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 2 | ||||
| -rw-r--r-- | services/surfaceflinger/tests/WindowInfosListener_test.cpp | 3 |
3 files changed, 18 insertions, 1 deletions
diff --git a/libs/gui/tests/EndToEndNativeInputTest.cpp b/libs/gui/tests/EndToEndNativeInputTest.cpp index 78a8b429c1..5daef0df28 100644 --- a/libs/gui/tests/EndToEndNativeInputTest.cpp +++ b/libs/gui/tests/EndToEndNativeInputTest.cpp @@ -931,6 +931,20 @@ TEST_F(InputSurfacesTest, strict_unobscured_input_cropped_window) { EXPECT_EQ(surface->consumeEvent(100), nullptr); } +TEST_F(InputSurfacesTest, ignore_touch_region_with_zero_sized_blast) { + std::unique_ptr<InputSurface> surface = makeSurface(100, 100); + + std::unique_ptr<BlastInputSurface> bufferSurface = + BlastInputSurface::makeBlastInputSurface(mComposerClient, 0, 0); + + surface->showAt(100, 100); + bufferSurface->mInputInfo.touchableRegion.orSelf(Rect(0, 0, 200, 200)); + bufferSurface->showAt(100, 100, Rect::EMPTY_RECT); + + injectTap(101, 101); + surface->expectTap(1, 1); +} + TEST_F(InputSurfacesTest, drop_input_policy) { std::unique_ptr<InputSurface> surface = makeSurface(100, 100); surface->doTransaction( diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index e2f34fabc2..e029e7d7c6 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -2213,6 +2213,8 @@ void Layer::fillInputFrameInfo(WindowInfo& info, const ui::Transform& toNonRotat info.frameRight = 0; info.frameBottom = 0; info.transform.reset(); + info.touchableRegion = Region(); + info.flags = WindowInfo::Flag::NOT_TOUCH_MODAL | WindowInfo::Flag::NOT_FOCUSABLE; return; } diff --git a/services/surfaceflinger/tests/WindowInfosListener_test.cpp b/services/surfaceflinger/tests/WindowInfosListener_test.cpp index 89228d55e5..15b79be06c 100644 --- a/services/surfaceflinger/tests/WindowInfosListener_test.cpp +++ b/services/surfaceflinger/tests/WindowInfosListener_test.cpp @@ -110,11 +110,12 @@ TEST_F(WindowInfosListenerTest, WindowInfoChanged) { sp<SurfaceControl> surfaceControl = mClient->createSurface(String8(name.c_str()), 100, 100, PIXEL_FORMAT_RGBA_8888, ISurfaceComposerClient::eFXSurfaceBufferState); - + const Rect crop(0, 0, 100, 100); Transaction() .setLayerStack(surfaceControl, 0) .show(surfaceControl) .setLayer(surfaceControl, INT32_MAX - 1) + .setCrop(surfaceControl, crop) .setInputWindowInfo(surfaceControl, windowInfo) .apply(); |