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

Commit 8c94e0d3 authored by Arpit Singh's avatar Arpit Singh Committed by Automerger Merge Worker
Browse files

Merge "InputMapper refactor: CursorInputMapper" into udc-dev am: f7066153 am: 4015edbc

parents 2c512bf0 4015edbc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -488,7 +488,7 @@ std::vector<std::unique_ptr<InputMapper>> InputDevice::createMappers(


    // Cursor-like devices.
    // Cursor-like devices.
    if (classes.test(InputDeviceClass::CURSOR)) {
    if (classes.test(InputDeviceClass::CURSOR)) {
        mappers.push_back(std::make_unique<CursorInputMapper>(contextPtr, readerConfig));
        mappers.push_back(createInputMapper<CursorInputMapper>(contextPtr, readerConfig));
    }
    }


    // Touchscreens and touchpad devices.
    // Touchscreens and touchpad devices.
+22 −30
Original line number Original line Diff line number Diff line
@@ -71,9 +71,7 @@ void CursorMotionAccumulator::finishSync() {
CursorInputMapper::CursorInputMapper(InputDeviceContext& deviceContext,
CursorInputMapper::CursorInputMapper(InputDeviceContext& deviceContext,
                                     const InputReaderConfiguration& readerConfig)
                                     const InputReaderConfiguration& readerConfig)
      : InputMapper(deviceContext, readerConfig),
      : InputMapper(deviceContext, readerConfig),
        mLastEventTime(std::numeric_limits<nsecs_t>::min()) {
        mLastEventTime(std::numeric_limits<nsecs_t>::min()) {}
    configureWithZeroChanges(readerConfig);
}


CursorInputMapper::~CursorInputMapper() {
CursorInputMapper::~CursorInputMapper() {
    if (mPointerController != nullptr) {
    if (mPointerController != nullptr) {
@@ -142,46 +140,51 @@ std::list<NotifyArgs> CursorInputMapper::reconfigure(nsecs_t when,
                                                     ConfigurationChanges changes) {
                                                     ConfigurationChanges changes) {
    std::list<NotifyArgs> out = InputMapper::reconfigure(when, readerConfig, changes);
    std::list<NotifyArgs> out = InputMapper::reconfigure(when, readerConfig, changes);


    if (!changes.any()) {
    if (!changes.any()) { // first time only
        configureWithZeroChanges(readerConfig);
        configureBasicParams();
        return out;
    }
    }


    const bool configurePointerCapture = mParameters.mode != Parameters::Mode::NAVIGATION &&
    const bool configurePointerCapture = !changes.any() ||
            changes.test(InputReaderConfiguration::Change::POINTER_CAPTURE);
            (mParameters.mode != Parameters::Mode::NAVIGATION &&
             changes.test(InputReaderConfiguration::Change::POINTER_CAPTURE));
    if (configurePointerCapture) {
    if (configurePointerCapture) {
        configureOnPointerCapture(readerConfig);
        configureOnPointerCapture(readerConfig);
        out.push_back(NotifyDeviceResetArgs(getContext()->getNextId(), when, getDeviceId()));
        out.push_back(NotifyDeviceResetArgs(getContext()->getNextId(), when, getDeviceId()));
    }
    }


    if (changes.test(InputReaderConfiguration::Change::POINTER_SPEED) || configurePointerCapture) {
    if (!changes.any() || changes.test(InputReaderConfiguration::Change::POINTER_SPEED) ||
        configurePointerCapture) {
        configureOnChangePointerSpeed(readerConfig);
        configureOnChangePointerSpeed(readerConfig);
    }
    }


    if (changes.test(InputReaderConfiguration::Change::DISPLAY_INFO) || configurePointerCapture) {
    if (!changes.any() || changes.test(InputReaderConfiguration::Change::DISPLAY_INFO) ||
        configurePointerCapture) {
        configureOnChangeDisplayInfo(readerConfig);
        configureOnChangeDisplayInfo(readerConfig);
    }
    }
    return out;
    return out;
}
}


void CursorInputMapper::configureParameters() {
CursorInputMapper::Parameters CursorInputMapper::computeParameters(
    mParameters.mode = Parameters::Mode::POINTER;
        const InputDeviceContext& deviceContext) {
    const PropertyMap& config = getDeviceContext().getConfiguration();
    Parameters parameters;
    parameters.mode = Parameters::Mode::POINTER;
    const PropertyMap& config = deviceContext.getConfiguration();
    std::optional<std::string> cursorModeString = config.getString("cursor.mode");
    std::optional<std::string> cursorModeString = config.getString("cursor.mode");
    if (cursorModeString.has_value()) {
    if (cursorModeString.has_value()) {
        if (*cursorModeString == "navigation") {
        if (*cursorModeString == "navigation") {
            mParameters.mode = Parameters::Mode::NAVIGATION;
            parameters.mode = Parameters::Mode::NAVIGATION;
        } else if (*cursorModeString != "pointer" && *cursorModeString != "default") {
        } else if (*cursorModeString != "pointer" && *cursorModeString != "default") {
            ALOGW("Invalid value for cursor.mode: '%s'", cursorModeString->c_str());
            ALOGW("Invalid value for cursor.mode: '%s'", cursorModeString->c_str());
        }
        }
    }
    }


    mParameters.orientationAware = config.getBool("cursor.orientationAware").value_or(false);
    parameters.orientationAware = config.getBool("cursor.orientationAware").value_or(false);


    mParameters.hasAssociatedDisplay = false;
    parameters.hasAssociatedDisplay = false;
    if (mParameters.mode == Parameters::Mode::POINTER || mParameters.orientationAware) {
    if (parameters.mode == Parameters::Mode::POINTER || parameters.orientationAware) {
        mParameters.hasAssociatedDisplay = true;
        parameters.hasAssociatedDisplay = true;
    }
    }
    return parameters;
}
}


void CursorInputMapper::dumpParameters(std::string& dump) {
void CursorInputMapper::dumpParameters(std::string& dump) {
@@ -424,22 +427,11 @@ std::optional<int32_t> CursorInputMapper::getAssociatedDisplayId() {
    return mDisplayId;
    return mDisplayId;
}
}


void CursorInputMapper::configureWithZeroChanges(const InputReaderConfiguration& readerConfig) {
    // Configuration with zero changes
    configureBasicParams();
    if (mParameters.mode != Parameters::Mode::NAVIGATION &&
        readerConfig.pointerCaptureRequest.enable) {
        configureOnPointerCapture(readerConfig);
    }
    configureOnChangePointerSpeed(readerConfig);
    configureOnChangeDisplayInfo(readerConfig);
}

void CursorInputMapper::configureBasicParams() {
void CursorInputMapper::configureBasicParams() {
    mCursorScrollAccumulator.configure(getDeviceContext());
    mCursorScrollAccumulator.configure(getDeviceContext());


    // Configure basic parameters.
    // Configure basic parameters.
    configureParameters();
    mParameters = computeParameters(getDeviceContext());


    // Configure device mode.
    // Configure device mode.
    switch (mParameters.mode) {
    switch (mParameters.mode) {
+8 −4
Original line number Original line Diff line number Diff line
@@ -53,8 +53,10 @@ private:


class CursorInputMapper : public InputMapper {
class CursorInputMapper : public InputMapper {
public:
public:
    explicit CursorInputMapper(InputDeviceContext& deviceContext,
    template <class T, class... Args>
                               const InputReaderConfiguration& readerConfig);
    friend std::unique_ptr<T> createInputMapper(InputDeviceContext& deviceContext,
                                                const InputReaderConfiguration& readerConfig,
                                                Args... args);
    virtual ~CursorInputMapper();
    virtual ~CursorInputMapper();


    virtual uint32_t getSources() const override;
    virtual uint32_t getSources() const override;
@@ -125,15 +127,17 @@ private:
    nsecs_t mDownTime;
    nsecs_t mDownTime;
    nsecs_t mLastEventTime;
    nsecs_t mLastEventTime;


    void configureParameters();
    explicit CursorInputMapper(InputDeviceContext& deviceContext,
                               const InputReaderConfiguration& readerConfig);
    void dumpParameters(std::string& dump);
    void dumpParameters(std::string& dump);
    void configureWithZeroChanges(const InputReaderConfiguration& readerConfig);
    void configureBasicParams();
    void configureBasicParams();
    void configureOnPointerCapture(const InputReaderConfiguration& config);
    void configureOnPointerCapture(const InputReaderConfiguration& config);
    void configureOnChangePointerSpeed(const InputReaderConfiguration& config);
    void configureOnChangePointerSpeed(const InputReaderConfiguration& config);
    void configureOnChangeDisplayInfo(const InputReaderConfiguration& config);
    void configureOnChangeDisplayInfo(const InputReaderConfiguration& config);


    [[nodiscard]] std::list<NotifyArgs> sync(nsecs_t when, nsecs_t readTime);
    [[nodiscard]] std::list<NotifyArgs> sync(nsecs_t when, nsecs_t readTime);

    static Parameters computeParameters(const InputDeviceContext& deviceContext);
};
};


} // namespace android
} // namespace android
+21 −21
Original line number Original line Diff line number Diff line
@@ -3862,21 +3862,21 @@ void CursorInputMapperTest::testMotionRotation(CursorInputMapper& mapper, int32_
TEST_F(CursorInputMapperTest, WhenModeIsPointer_GetSources_ReturnsMouse) {
TEST_F(CursorInputMapperTest, WhenModeIsPointer_GetSources_ReturnsMouse) {
    addConfigurationProperty("cursor.mode", "pointer");
    addConfigurationProperty("cursor.mode", "pointer");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    ASSERT_EQ(AINPUT_SOURCE_MOUSE, mapper.getSources());
    ASSERT_EQ(AINPUT_SOURCE_MOUSE, mapper.getSources());
}
}
TEST_F(CursorInputMapperTest, WhenModeIsNavigation_GetSources_ReturnsTrackball) {
TEST_F(CursorInputMapperTest, WhenModeIsNavigation_GetSources_ReturnsTrackball) {
    addConfigurationProperty("cursor.mode", "navigation");
    addConfigurationProperty("cursor.mode", "navigation");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    ASSERT_EQ(AINPUT_SOURCE_TRACKBALL, mapper.getSources());
    ASSERT_EQ(AINPUT_SOURCE_TRACKBALL, mapper.getSources());
}
}
TEST_F(CursorInputMapperTest, WhenModeIsPointer_PopulateDeviceInfo_ReturnsRangeFromPointerController) {
TEST_F(CursorInputMapperTest, WhenModeIsPointer_PopulateDeviceInfo_ReturnsRangeFromPointerController) {
    addConfigurationProperty("cursor.mode", "pointer");
    addConfigurationProperty("cursor.mode", "pointer");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    InputDeviceInfo info;
    InputDeviceInfo info;
    mapper.populateDeviceInfo(info);
    mapper.populateDeviceInfo(info);
@@ -3906,7 +3906,7 @@ TEST_F(CursorInputMapperTest, WhenModeIsPointer_PopulateDeviceInfo_ReturnsRangeF
TEST_F(CursorInputMapperTest, WhenModeIsNavigation_PopulateDeviceInfo_ReturnsScaledRange) {
TEST_F(CursorInputMapperTest, WhenModeIsNavigation_PopulateDeviceInfo_ReturnsScaledRange) {
    addConfigurationProperty("cursor.mode", "navigation");
    addConfigurationProperty("cursor.mode", "navigation");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    InputDeviceInfo info;
    InputDeviceInfo info;
    mapper.populateDeviceInfo(info);
    mapper.populateDeviceInfo(info);
@@ -3924,7 +3924,7 @@ TEST_F(CursorInputMapperTest, WhenModeIsNavigation_PopulateDeviceInfo_ReturnsSca
TEST_F(CursorInputMapperTest, Process_ShouldSetAllFieldsAndIncludeGlobalMetaState) {
TEST_F(CursorInputMapperTest, Process_ShouldSetAllFieldsAndIncludeGlobalMetaState) {
    addConfigurationProperty("cursor.mode", "navigation");
    addConfigurationProperty("cursor.mode", "navigation");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    mReader->getContext()->setGlobalMetaState(AMETA_SHIFT_LEFT_ON | AMETA_SHIFT_ON);
    mReader->getContext()->setGlobalMetaState(AMETA_SHIFT_LEFT_ON | AMETA_SHIFT_ON);
@@ -4012,7 +4012,7 @@ TEST_F(CursorInputMapperTest, Process_ShouldSetAllFieldsAndIncludeGlobalMetaStat
TEST_F(CursorInputMapperTest, Process_ShouldHandleIndependentXYUpdates) {
TEST_F(CursorInputMapperTest, Process_ShouldHandleIndependentXYUpdates) {
    addConfigurationProperty("cursor.mode", "navigation");
    addConfigurationProperty("cursor.mode", "navigation");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    NotifyMotionArgs args;
    NotifyMotionArgs args;
@@ -4036,7 +4036,7 @@ TEST_F(CursorInputMapperTest, Process_ShouldHandleIndependentXYUpdates) {
TEST_F(CursorInputMapperTest, Process_ShouldHandleIndependentButtonUpdates) {
TEST_F(CursorInputMapperTest, Process_ShouldHandleIndependentButtonUpdates) {
    addConfigurationProperty("cursor.mode", "navigation");
    addConfigurationProperty("cursor.mode", "navigation");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    NotifyMotionArgs args;
    NotifyMotionArgs args;
@@ -4065,7 +4065,7 @@ TEST_F(CursorInputMapperTest, Process_ShouldHandleIndependentButtonUpdates) {
TEST_F(CursorInputMapperTest, Process_ShouldHandleCombinedXYAndButtonUpdates) {
TEST_F(CursorInputMapperTest, Process_ShouldHandleCombinedXYAndButtonUpdates) {
    addConfigurationProperty("cursor.mode", "navigation");
    addConfigurationProperty("cursor.mode", "navigation");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    NotifyMotionArgs args;
    NotifyMotionArgs args;
@@ -4114,7 +4114,7 @@ TEST_F(CursorInputMapperTest, Process_WhenOrientationAware_ShouldNotRotateMotion
    // InputReader works in the un-rotated coordinate space, so orientation-aware devices do not
    // InputReader works in the un-rotated coordinate space, so orientation-aware devices do not
    // need to be rotated.
    // need to be rotated.
    addConfigurationProperty("cursor.orientationAware", "1");
    addConfigurationProperty("cursor.orientationAware", "1");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    prepareDisplay(ui::ROTATION_90);
    prepareDisplay(ui::ROTATION_90);
    ASSERT_NO_FATAL_FAILURE(testMotionRotation(mapper,  0,  1,  0,  1));
    ASSERT_NO_FATAL_FAILURE(testMotionRotation(mapper,  0,  1,  0,  1));
@@ -4132,7 +4132,7 @@ TEST_F(CursorInputMapperTest, Process_WhenNotOrientationAware_ShouldRotateMotion
    addConfigurationProperty("cursor.mode", "navigation");
    addConfigurationProperty("cursor.mode", "navigation");
    // Since InputReader works in the un-rotated coordinate space, only devices that are not
    // Since InputReader works in the un-rotated coordinate space, only devices that are not
    // orientation-aware are affected by display rotation.
    // orientation-aware are affected by display rotation.
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    clearViewports();
    clearViewports();
    prepareDisplay(ui::ROTATION_0);
    prepareDisplay(ui::ROTATION_0);
@@ -4181,7 +4181,7 @@ TEST_F(CursorInputMapperTest, Process_WhenNotOrientationAware_ShouldRotateMotion
TEST_F(CursorInputMapperTest, Process_ShouldHandleAllButtons) {
TEST_F(CursorInputMapperTest, Process_ShouldHandleAllButtons) {
    addConfigurationProperty("cursor.mode", "pointer");
    addConfigurationProperty("cursor.mode", "pointer");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    mFakePointerController->setBounds(0, 0, 800 - 1, 480 - 1);
    mFakePointerController->setBounds(0, 0, 800 - 1, 480 - 1);
    mFakePointerController->setPosition(100, 200);
    mFakePointerController->setPosition(100, 200);
@@ -4435,7 +4435,7 @@ TEST_F(CursorInputMapperTest, Process_ShouldHandleAllButtons) {
TEST_F(CursorInputMapperTest, Process_WhenModeIsPointer_ShouldMoveThePointerAround) {
TEST_F(CursorInputMapperTest, Process_WhenModeIsPointer_ShouldMoveThePointerAround) {
    addConfigurationProperty("cursor.mode", "pointer");
    addConfigurationProperty("cursor.mode", "pointer");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    mFakePointerController->setBounds(0, 0, 800 - 1, 480 - 1);
    mFakePointerController->setBounds(0, 0, 800 - 1, 480 - 1);
    mFakePointerController->setPosition(100, 200);
    mFakePointerController->setPosition(100, 200);
@@ -4456,7 +4456,7 @@ TEST_F(CursorInputMapperTest, Process_WhenModeIsPointer_ShouldMoveThePointerArou
TEST_F(CursorInputMapperTest, Process_PointerCapture) {
TEST_F(CursorInputMapperTest, Process_PointerCapture) {
    addConfigurationProperty("cursor.mode", "pointer");
    addConfigurationProperty("cursor.mode", "pointer");
    mFakePolicy->setPointerCapture(true);
    mFakePolicy->setPointerCapture(true);
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    NotifyDeviceResetArgs resetArgs;
    NotifyDeviceResetArgs resetArgs;
    ASSERT_NO_FATAL_FAILURE(mFakeListener->assertNotifyDeviceResetWasCalled(&resetArgs));
    ASSERT_NO_FATAL_FAILURE(mFakeListener->assertNotifyDeviceResetWasCalled(&resetArgs));
@@ -4548,7 +4548,7 @@ TEST_F(CursorInputMapperTest, PointerCaptureDisablesVelocityProcessing) {
    const VelocityControlParameters testParams(/*scale=*/5.f, /*low threshold=*/0.f,
    const VelocityControlParameters testParams(/*scale=*/5.f, /*low threshold=*/0.f,
                                               /*high threshold=*/100.f, /*acceleration=*/10.f);
                                               /*high threshold=*/100.f, /*acceleration=*/10.f);
    mFakePolicy->setVelocityControlParams(testParams);
    mFakePolicy->setVelocityControlParams(testParams);
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    NotifyDeviceResetArgs resetArgs;
    NotifyDeviceResetArgs resetArgs;
    ASSERT_NO_FATAL_FAILURE(mFakeListener->assertNotifyDeviceResetWasCalled(&resetArgs));
    ASSERT_NO_FATAL_FAILURE(mFakeListener->assertNotifyDeviceResetWasCalled(&resetArgs));
@@ -4589,7 +4589,7 @@ TEST_F(CursorInputMapperTest, PointerCaptureDisablesVelocityProcessing) {
TEST_F(CursorInputMapperTest, PointerCaptureDisablesOrientationChanges) {
TEST_F(CursorInputMapperTest, PointerCaptureDisablesOrientationChanges) {
    addConfigurationProperty("cursor.mode", "pointer");
    addConfigurationProperty("cursor.mode", "pointer");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    NotifyDeviceResetArgs resetArgs;
    NotifyDeviceResetArgs resetArgs;
    ASSERT_NO_FATAL_FAILURE(mFakeListener->assertNotifyDeviceResetWasCalled(&resetArgs));
    ASSERT_NO_FATAL_FAILURE(mFakeListener->assertNotifyDeviceResetWasCalled(&resetArgs));
@@ -4630,7 +4630,7 @@ TEST_F(CursorInputMapperTest, PointerCaptureDisablesOrientationChanges) {
}
}
TEST_F(CursorInputMapperTest, ConfigureDisplayId_NoAssociatedViewport) {
TEST_F(CursorInputMapperTest, ConfigureDisplayId_NoAssociatedViewport) {
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    // Set up the default display.
    // Set up the default display.
    prepareDisplay(ui::ROTATION_90);
    prepareDisplay(ui::ROTATION_90);
@@ -4656,7 +4656,7 @@ TEST_F(CursorInputMapperTest, ConfigureDisplayId_NoAssociatedViewport) {
}
}
TEST_F(CursorInputMapperTest, ConfigureDisplayId_WithAssociatedViewport) {
TEST_F(CursorInputMapperTest, ConfigureDisplayId_WithAssociatedViewport) {
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    // Set up the default display.
    // Set up the default display.
    prepareDisplay(ui::ROTATION_90);
    prepareDisplay(ui::ROTATION_90);
@@ -4682,7 +4682,7 @@ TEST_F(CursorInputMapperTest, ConfigureDisplayId_WithAssociatedViewport) {
}
}
TEST_F(CursorInputMapperTest, ConfigureDisplayId_IgnoresEventsForMismatchedPointerDisplay) {
TEST_F(CursorInputMapperTest, ConfigureDisplayId_IgnoresEventsForMismatchedPointerDisplay) {
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    // Set up the default display as the display on which the pointer should be shown.
    // Set up the default display as the display on which the pointer should be shown.
    prepareDisplay(ui::ROTATION_90);
    prepareDisplay(ui::ROTATION_90);
@@ -4715,7 +4715,7 @@ protected:
TEST_F(BluetoothCursorInputMapperTest, TimestampSmoothening) {
TEST_F(BluetoothCursorInputMapperTest, TimestampSmoothening) {
    addConfigurationProperty("cursor.mode", "pointer");
    addConfigurationProperty("cursor.mode", "pointer");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    nsecs_t kernelEventTime = ARBITRARY_TIME;
    nsecs_t kernelEventTime = ARBITRARY_TIME;
    nsecs_t expectedEventTime = ARBITRARY_TIME;
    nsecs_t expectedEventTime = ARBITRARY_TIME;
@@ -4742,7 +4742,7 @@ TEST_F(BluetoothCursorInputMapperTest, TimestampSmoothening) {
TEST_F(BluetoothCursorInputMapperTest, TimestampSmootheningIsCapped) {
TEST_F(BluetoothCursorInputMapperTest, TimestampSmootheningIsCapped) {
    addConfigurationProperty("cursor.mode", "pointer");
    addConfigurationProperty("cursor.mode", "pointer");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    nsecs_t expectedEventTime = ARBITRARY_TIME;
    nsecs_t expectedEventTime = ARBITRARY_TIME;
    process(mapper, ARBITRARY_TIME, READ_TIME, EV_REL, REL_X, 1);
    process(mapper, ARBITRARY_TIME, READ_TIME, EV_REL, REL_X, 1);
@@ -4779,7 +4779,7 @@ TEST_F(BluetoothCursorInputMapperTest, TimestampSmootheningIsCapped) {
TEST_F(BluetoothCursorInputMapperTest, TimestampSmootheningNotUsed) {
TEST_F(BluetoothCursorInputMapperTest, TimestampSmootheningNotUsed) {
    addConfigurationProperty("cursor.mode", "pointer");
    addConfigurationProperty("cursor.mode", "pointer");
    CursorInputMapper& mapper = addMapperAndConfigure<CursorInputMapper>();
    CursorInputMapper& mapper = constructAndAddMapper<CursorInputMapper>();
    nsecs_t kernelEventTime = ARBITRARY_TIME;
    nsecs_t kernelEventTime = ARBITRARY_TIME;
    nsecs_t expectedEventTime = ARBITRARY_TIME;
    nsecs_t expectedEventTime = ARBITRARY_TIME;