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

Commit 77b3f6fe authored by Michael Checo's avatar Michael Checo Committed by Android (Google) Code Review
Browse files

Merge "Refactor: Rename displaysWithMousePointerAccelerationDisabled" into main

parents a1635a6f 923b24ea
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -143,7 +143,7 @@ struct InputReaderConfiguration {
    // user's pointer speed setting, should be disabled for mice. This differs from
    // disabling acceleration via the 'mousePointerAccelerationEnabled' setting, where
    // the pointer speed setting still influences the scaling factor.
    std::set<ui::LogicalDisplayId> displaysWithMousePointerAccelerationDisabled;
    std::set<ui::LogicalDisplayId> displaysWithMouseScalingDisabled;

    // True if the connected mouse should exhibit pointer acceleration. If false,
    // a flat acceleration curve (linear scaling) is used, but the user's pointer
@@ -282,7 +282,7 @@ struct InputReaderConfiguration {
          : virtualKeyQuietTime(0),
            defaultPointerDisplayId(ui::LogicalDisplayId::DEFAULT),
            mousePointerSpeed(0),
            displaysWithMousePointerAccelerationDisabled(),
            displaysWithMouseScalingDisabled(),
            mousePointerAccelerationEnabled(true),
            pointerVelocityControlParameters(1.0f, 500.0f, 3000.0f,
                                             static_cast<float>(
+1 −1
Original line number Diff line number Diff line
@@ -484,7 +484,7 @@ void CursorInputMapper::configureOnChangePointerSpeed(const InputReaderConfigura
        return;
    }

    bool disableAllScaling = config.displaysWithMousePointerAccelerationDisabled.count(
    bool disableAllScaling = config.displaysWithMouseScalingDisabled.count(
                                     mDisplayId.value_or(ui::LogicalDisplayId::INVALID)) != 0;

    mPointerVelocityControl.setAccelerationEnabled(!disableAllScaling);
+2 −2
Original line number Diff line number Diff line
@@ -1078,7 +1078,7 @@ TEST_F(CursorInputMapperUnitTest, ConfigureAccelerationWithAssociatedViewport) {
    ASSERT_GT(coords.getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_Y), 20.f);

    // Disable acceleration for the display, and verify that acceleration is no longer applied.
    mReaderConfiguration.displaysWithMousePointerAccelerationDisabled.emplace(DISPLAY_ID);
    mReaderConfiguration.displaysWithMouseScalingDisabled.emplace(DISPLAY_ID);
    args += mMapper->reconfigure(ARBITRARY_TIME, mReaderConfiguration,
                                 InputReaderConfiguration::Change::POINTER_SPEED);
    args.clear();
@@ -1097,7 +1097,7 @@ TEST_F(CursorInputMapperUnitTest, ConfigureAccelerationOnDisplayChange) {
    DisplayViewport primaryViewport = createPrimaryViewport(ui::Rotation::Rotation0);
    mReaderConfiguration.setDisplayViewports({primaryViewport});
    // Disable acceleration for the display.
    mReaderConfiguration.displaysWithMousePointerAccelerationDisabled.emplace(DISPLAY_ID);
    mReaderConfiguration.displaysWithMouseScalingDisabled.emplace(DISPLAY_ID);

    // Don't associate the device with the display yet.
    EXPECT_CALL((*mDevice), getAssociatedViewport).WillRepeatedly(Return(std::nullopt));