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

Commit 88ada248 authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Android (Google) Code Review
Browse files

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

parents c7da704e f98655a3
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