Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 814a38b3 authored by Arthur Hung's avatar Arthur Hung Committed by Automerger Merge Worker
Browse files

Merge "Let touch region empty if the input bounds is empty" into sc-v2-dev am:...

Merge "Let touch region empty if the input bounds is empty" into sc-v2-dev am: d0896e2d am: bc4ca888

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/16303692

Change-Id: I731dcb394a1424edb401021fd8d52e189a0ffb10
parents 9b3e9971 bc4ca888
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -936,6 +936,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(
+2 −0
Original line number Diff line number Diff line
@@ -2169,6 +2169,8 @@ void Layer::fillInputFrameInfo(WindowInfo& info, const ui::Transform& displayTra
        info.frameRight = 0;
        info.frameBottom = 0;
        info.transform.reset();
        info.touchableRegion = Region();
        info.flags = WindowInfo::Flag::NOT_TOUCH_MODAL | WindowInfo::Flag::NOT_FOCUSABLE;
        return;
    }

+2 −1
Original line number Diff line number Diff line
@@ -112,11 +112,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, ui::DEFAULT_LAYER_STACK)
            .show(surfaceControl)
            .setLayer(surfaceControl, INT32_MAX - 1)
            .setCrop(surfaceControl, crop)
            .setInputWindowInfo(surfaceControl, windowInfo)
            .apply();