Skip to content

Commit 77b3f6f

Browse files
Michael ChecoAndroid (Google) Code Review
authored andcommitted
Merge "Refactor: Rename displaysWithMousePointerAccelerationDisabled" into main
2 parents a1635a6 + 923b24e commit 77b3f6f

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

services/inputflinger/include/InputReaderBase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ struct InputReaderConfiguration {
143143
// user's pointer speed setting, should be disabled for mice. This differs from
144144
// disabling acceleration via the 'mousePointerAccelerationEnabled' setting, where
145145
// the pointer speed setting still influences the scaling factor.
146-
std::set<ui::LogicalDisplayId> displaysWithMousePointerAccelerationDisabled;
146+
std::set<ui::LogicalDisplayId> displaysWithMouseScalingDisabled;
147147

148148
// True if the connected mouse should exhibit pointer acceleration. If false,
149149
// a flat acceleration curve (linear scaling) is used, but the user's pointer
@@ -282,7 +282,7 @@ struct InputReaderConfiguration {
282282
: virtualKeyQuietTime(0),
283283
defaultPointerDisplayId(ui::LogicalDisplayId::DEFAULT),
284284
mousePointerSpeed(0),
285-
displaysWithMousePointerAccelerationDisabled(),
285+
displaysWithMouseScalingDisabled(),
286286
mousePointerAccelerationEnabled(true),
287287
pointerVelocityControlParameters(1.0f, 500.0f, 3000.0f,
288288
static_cast<float>(

services/inputflinger/reader/mapper/CursorInputMapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ void CursorInputMapper::configureOnChangePointerSpeed(const InputReaderConfigura
484484
return;
485485
}
486486

487-
bool disableAllScaling = config.displaysWithMousePointerAccelerationDisabled.count(
487+
bool disableAllScaling = config.displaysWithMouseScalingDisabled.count(
488488
mDisplayId.value_or(ui::LogicalDisplayId::INVALID)) != 0;
489489

490490
mPointerVelocityControl.setAccelerationEnabled(!disableAllScaling);

services/inputflinger/tests/CursorInputMapper_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ TEST_F(CursorInputMapperUnitTest, ConfigureAccelerationWithAssociatedViewport) {
10781078
ASSERT_GT(coords.getAxisValue(AMOTION_EVENT_AXIS_RELATIVE_Y), 20.f);
10791079

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

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

0 commit comments

Comments
 (0)