Skip to content

Commit 509f629

Browse files
Treehugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "inputflinger: remove edge flags from NotifyMotionArgs constructor" into main
2 parents a83d862 + 44fd292 commit 509f629

18 files changed

+84
-107
lines changed

services/inputflinger/NotifyArgs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ NotifyMotionArgs::NotifyMotionArgs(
6161
int32_t id, nsecs_t eventTime, nsecs_t readTime, int32_t deviceId, uint32_t source,
6262
ui::LogicalDisplayId displayId, uint32_t policyFlags, int32_t action, int32_t actionButton,
6363
int32_t flags, int32_t metaState, int32_t buttonState, MotionClassification classification,
64-
int32_t edgeFlags, uint32_t pointerCount, const PointerProperties* pointerProperties,
64+
uint32_t pointerCount, const PointerProperties* pointerProperties,
6565
const PointerCoords* pointerCoords, float xPrecision, float yPrecision,
6666
float xCursorPosition, float yCursorPosition, nsecs_t downTime,
6767
const std::vector<TouchVideoFrame>& videoFrames)
@@ -77,7 +77,7 @@ NotifyMotionArgs::NotifyMotionArgs(
7777
metaState(metaState),
7878
buttonState(buttonState),
7979
classification(classification),
80-
edgeFlags(edgeFlags),
80+
edgeFlags(AMOTION_EVENT_EDGE_FLAG_NONE),
8181
xPrecision(xPrecision),
8282
yPrecision(yPrecision),
8383
xCursorPosition(xCursorPosition),

services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ static NotifyMotionArgs generateMotionArgs() {
9191
DEVICE_ID, AINPUT_SOURCE_TOUCHSCREEN, ui::LogicalDisplayId::DEFAULT,
9292
POLICY_FLAG_PASS_TO_USER, AMOTION_EVENT_ACTION_DOWN,
9393
/* actionButton */ 0, /* flags */ 0, AMETA_NONE, /* buttonState */ 0,
94-
MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
95-
pointerProperties, pointerCoords,
94+
MotionClassification::NONE, 1, pointerProperties, pointerCoords,
9695
/* xPrecision */ 0, /* yPrecision */ 0,
9796
AMOTION_EVENT_INVALID_CURSOR_POSITION,
9897
AMOTION_EVENT_INVALID_CURSOR_POSITION, currentTime, /* videoFrames */ {});

services/inputflinger/include/NotifyArgs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct NotifyMotionArgs {
110110
NotifyMotionArgs(int32_t id, nsecs_t eventTime, nsecs_t readTime, int32_t deviceId,
111111
uint32_t source, ui::LogicalDisplayId displayId, uint32_t policyFlags,
112112
int32_t action, int32_t actionButton, int32_t flags, int32_t metaState,
113-
int32_t buttonState, MotionClassification classification, int32_t edgeFlags,
113+
int32_t buttonState, MotionClassification classification,
114114
uint32_t pointerCount, const PointerProperties* pointerProperties,
115115
const PointerCoords* pointerCoords, float xPrecision, float yPrecision,
116116
float xCursorPosition, float yCursorPosition, nsecs_t downTime,

services/inputflinger/include/NotifyArgsBuilders.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ class MotionArgsBuilder {
139139
AMETA_NONE,
140140
mButtonState,
141141
mClassification,
142-
/*edgeFlags=*/0,
143142
static_cast<uint32_t>(mPointers.size()),
144143
pointerProperties.data(),
145144
pointerCoords.data(),

services/inputflinger/reader/mapper/CapturedTouchpadEventConverter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ NotifyMotionArgs CapturedTouchpadEventConverter::makeMotionArgs(
313313
ui::LogicalDisplayId::INVALID, /*policyFlags=*/POLICY_FLAG_WAKE, action,
314314
/*actionButton=*/actionButton, flags,
315315
mReaderContext.getGlobalMetaState(), mButtonState,
316-
MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, coords.size(),
317-
properties.data(), coords.data(), /*xPrecision=*/1.0f,
316+
MotionClassification::NONE, coords.size(), properties.data(),
317+
coords.data(), /*xPrecision=*/1.0f,
318318
/*yPrecision=*/1.0f, AMOTION_EVENT_INVALID_CURSOR_POSITION,
319319
AMOTION_EVENT_INVALID_CURSOR_POSITION, mDownTime, /*videoFrames=*/{});
320320
}

services/inputflinger/reader/mapper/CursorInputMapper.cpp

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -340,19 +340,17 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
340340
getDeviceId(), mSource, *mDisplayId, policyFlags,
341341
AMOTION_EVENT_ACTION_BUTTON_RELEASE, actionButton, 0,
342342
metaState, buttonState, MotionClassification::NONE,
343-
AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
344-
&pointerCoords, mXPrecision, mYPrecision,
345-
xCursorPosition, yCursorPosition, downTime,
346-
/*videoFrames=*/{}));
343+
1, &pointerProperties, &pointerCoords, mXPrecision,
344+
mYPrecision, xCursorPosition, yCursorPosition,
345+
downTime, /*videoFrames=*/{}));
347346
}
348347
}
349348

350349
out.push_back(NotifyMotionArgs(getContext()->getNextId(), when, readTime, getDeviceId(),
351350
mSource, *mDisplayId, policyFlags, motionEventAction, 0, 0,
352-
metaState, currentButtonState, MotionClassification::NONE,
353-
AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
354-
&pointerCoords, mXPrecision, mYPrecision, xCursorPosition,
355-
yCursorPosition, downTime,
351+
metaState, currentButtonState, MotionClassification::NONE, 1,
352+
&pointerProperties, &pointerCoords, mXPrecision, mYPrecision,
353+
xCursorPosition, yCursorPosition, downTime,
356354
/*videoFrames=*/{}));
357355

358356
if (buttonsPressed) {
@@ -364,10 +362,9 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
364362
getDeviceId(), mSource, *mDisplayId, policyFlags,
365363
AMOTION_EVENT_ACTION_BUTTON_PRESS, actionButton, 0,
366364
metaState, buttonState, MotionClassification::NONE,
367-
AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
368-
&pointerCoords, mXPrecision, mYPrecision,
369-
xCursorPosition, yCursorPosition, downTime,
370-
/*videoFrames=*/{}));
365+
1, &pointerProperties, &pointerCoords, mXPrecision,
366+
mYPrecision, xCursorPosition, yCursorPosition,
367+
downTime, /*videoFrames=*/{}));
371368
}
372369
}
373370

@@ -378,10 +375,9 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
378375
out.push_back(NotifyMotionArgs(getContext()->getNextId(), when, readTime, getDeviceId(),
379376
mSource, *mDisplayId, policyFlags,
380377
AMOTION_EVENT_ACTION_HOVER_MOVE, 0, 0, metaState,
381-
currentButtonState, MotionClassification::NONE,
382-
AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
383-
&pointerCoords, mXPrecision, mYPrecision,
384-
xCursorPosition, yCursorPosition, downTime,
378+
currentButtonState, MotionClassification::NONE, 1,
379+
&pointerProperties, &pointerCoords, mXPrecision,
380+
mYPrecision, xCursorPosition, yCursorPosition, downTime,
385381
/*videoFrames=*/{}));
386382
}
387383

@@ -393,10 +389,9 @@ std::list<NotifyArgs> CursorInputMapper::sync(nsecs_t when, nsecs_t readTime) {
393389
out.push_back(NotifyMotionArgs(getContext()->getNextId(), when, readTime, getDeviceId(),
394390
mSource, *mDisplayId, policyFlags,
395391
AMOTION_EVENT_ACTION_SCROLL, 0, 0, metaState,
396-
currentButtonState, MotionClassification::NONE,
397-
AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
398-
&pointerCoords, mXPrecision, mYPrecision,
399-
xCursorPosition, yCursorPosition, downTime,
392+
currentButtonState, MotionClassification::NONE, 1,
393+
&pointerProperties, &pointerCoords, mXPrecision,
394+
mYPrecision, xCursorPosition, yCursorPosition, downTime,
400395
/*videoFrames=*/{}));
401396
}
402397
}

services/inputflinger/reader/mapper/JoystickInputMapper.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,8 @@ std::list<NotifyArgs> JoystickInputMapper::sync(nsecs_t when, nsecs_t readTime,
348348
out.push_back(NotifyMotionArgs(getContext()->getNextId(), when, readTime, getDeviceId(),
349349
AINPUT_SOURCE_JOYSTICK, displayId, policyFlags,
350350
AMOTION_EVENT_ACTION_MOVE, 0, 0, metaState, buttonState,
351-
MotionClassification::NONE, AMOTION_EVENT_EDGE_FLAG_NONE, 1,
352-
&pointerProperties, &pointerCoords, 0, 0,
353-
AMOTION_EVENT_INVALID_CURSOR_POSITION,
351+
MotionClassification::NONE, 1, &pointerProperties,
352+
&pointerCoords, 0, 0, AMOTION_EVENT_INVALID_CURSOR_POSITION,
354353
AMOTION_EVENT_INVALID_CURSOR_POSITION, 0, /*videoFrames=*/{}));
355354
return out;
356355
}

services/inputflinger/reader/mapper/RotaryEncoderInputMapper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ std::list<NotifyArgs> RotaryEncoderInputMapper::sync(nsecs_t when, nsecs_t readT
205205
out.push_back(
206206
NotifyMotionArgs(getContext()->getNextId(), when, readTime, getDeviceId(), mSource,
207207
mDisplayId, policyFlags, AMOTION_EVENT_ACTION_SCROLL, 0, 0,
208-
metaState, /*buttonState=*/0, MotionClassification::NONE,
209-
AMOTION_EVENT_EDGE_FLAG_NONE, 1, &pointerProperties,
210-
&pointerCoords, 0, 0, AMOTION_EVENT_INVALID_CURSOR_POSITION,
208+
metaState, /*buttonState=*/0, MotionClassification::NONE, 1,
209+
&pointerProperties, &pointerCoords, 0, 0,
210+
AMOTION_EVENT_INVALID_CURSOR_POSITION,
211211
AMOTION_EVENT_INVALID_CURSOR_POSITION, 0, /*videoFrames=*/{}));
212212
}
213213

0 commit comments

Comments
 (0)