InputMapper: pass RawEvent references instead of pointers
We never pass null values here, so changing to references makes this
clearer.
Change-Id: I82d5359e244a93560bcbef477c89fef016168abb
Test: atest inputflinger_test
Test: m checkinput
Test: manually test basic functionality on a multi-touch screen, touchpad, mouse, and drawing tablet
Bug: 245989146
Flag: EXEMPT refactor
diff --git a/services/inputflinger/reader/mapper/ExternalStylusInputMapper.cpp b/services/inputflinger/reader/mapper/ExternalStylusInputMapper.cpp
index 7f7e0dd..3af1d04 100644
--- a/services/inputflinger/reader/mapper/ExternalStylusInputMapper.cpp
+++ b/services/inputflinger/reader/mapper/ExternalStylusInputMapper.cpp
@@ -61,13 +61,13 @@
return InputMapper::reset(when);
}
-std::list<NotifyArgs> ExternalStylusInputMapper::process(const RawEvent* rawEvent) {
+std::list<NotifyArgs> ExternalStylusInputMapper::process(const RawEvent& rawEvent) {
std::list<NotifyArgs> out;
- mSingleTouchMotionAccumulator.process(*rawEvent);
- mTouchButtonAccumulator.process(*rawEvent);
+ mSingleTouchMotionAccumulator.process(rawEvent);
+ mTouchButtonAccumulator.process(rawEvent);
- if (rawEvent->type == EV_SYN && rawEvent->code == SYN_REPORT) {
- out += sync(rawEvent->when);
+ if (rawEvent.type == EV_SYN && rawEvent.code == SYN_REPORT) {
+ out += sync(rawEvent.when);
}
return out;
}