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

Commit 91a288ff authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Automerger Merge Worker
Browse files

Merge "Do not enforce that layers with invalid bounds are not focusable" into tm-dev am: 88ada248

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

Change-Id: I8cc37ff4c0f0930994c5f056cf41a613c9976e16
parents 9a22315c 88ada248
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -995,21 +995,6 @@ TEST_F(InputSurfacesTest, drop_input_policy) {
    EXPECT_EQ(surface->consumeEvent(100), nullptr);
}

TEST_F(InputSurfacesTest, layer_with_empty_crop_cannot_be_focused) {
    std::unique_ptr<InputSurface> bufferSurface =
            InputSurface::makeBufferInputSurface(mComposerClient, 100, 100);

    bufferSurface->showAt(50, 50, Rect::EMPTY_RECT);

    bufferSurface->requestFocus();
    EXPECT_EQ(bufferSurface->consumeEvent(100), nullptr);

    bufferSurface->showAt(50, 50, Rect::INVALID_RECT);

    bufferSurface->requestFocus();
    EXPECT_EQ(bufferSurface->consumeEvent(100), nullptr);
}

TEST_F(InputSurfacesTest, layer_with_valid_crop_can_be_focused) {
    std::unique_ptr<InputSurface> bufferSurface =
            InputSurface::makeBufferInputSurface(mComposerClient, 100, 100);
+0 −1
Original line number Diff line number Diff line
@@ -2208,7 +2208,6 @@ Rect Layer::getInputBounds() const {
void Layer::fillInputFrameInfo(WindowInfo& info, const ui::Transform& screenToDisplay) {
    Rect tmpBounds = getInputBounds();
    if (!tmpBounds.isValid()) {
        info.setInputConfig(WindowInfo::InputConfig::NOT_FOCUSABLE, true);
        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