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

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

Merge "TouchInputMapper: Fix display association for POINTER mode" into main

parents fe2b1189 8f1a0c3f
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -3476,7 +3476,7 @@ std::list<NotifyArgs> TouchInputMapper::dispatchPointerMouse(nsecs_t when, nsecs
    }

    return dispatchPointerSimple(when, readTime, policyFlags, down, hovering,
                                 ui::LogicalDisplayId::INVALID);
                                 getAssociatedDisplayId().value_or(ui::LogicalDisplayId::INVALID));
}

std::list<NotifyArgs> TouchInputMapper::abortPointerMouse(nsecs_t when, nsecs_t readTime,
@@ -3967,14 +3967,8 @@ bool TouchInputMapper::markSupportedKeyCodes(uint32_t sourceMask,
}

std::optional<ui::LogicalDisplayId> TouchInputMapper::getAssociatedDisplayId() {
    if (mParameters.hasAssociatedDisplay) {
        if (mDeviceMode == DeviceMode::POINTER) {
            return ui::LogicalDisplayId::INVALID;
        } else {
            return std::make_optional(mViewport.displayId);
        }
    }
    return std::nullopt;
    return mParameters.hasAssociatedDisplay ? std::make_optional(mViewport.displayId)
                                            : std::nullopt;
}

} // namespace android
+1 −1
Original line number Diff line number Diff line
@@ -7534,7 +7534,7 @@ TEST_F(MultiTouchInputMapperTest, Process_Pointer_ShouldHandleDisplayId) {

    ASSERT_NO_FATAL_FAILURE(mFakeListener->assertNotifyMotionWasCalled(&motionArgs));
    ASSERT_EQ(AMOTION_EVENT_ACTION_HOVER_MOVE, motionArgs.action);
    ASSERT_EQ(ui::LogicalDisplayId::INVALID, motionArgs.displayId);
    ASSERT_EQ(DISPLAY_ID, motionArgs.displayId);
}

/**