Add hmac to InputEvent and scale to MotionEvent
We need to pass some additional data to the app to be able to construct
the MotionEvent.
For proper support of getRawX/getRawY, add the xScale and yScale to
MotionEvent.
For the verification of input events, add hmac to InputEvent.
Bug: 134977432
Bug: 140786233
Test: atest libinput_tests inputflinger_tests
Change-Id: Ia3400ebbd9698549aad4d97a3b789ab7e10f6b65
diff --git a/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp b/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp
index 246e735..9a6ef21 100644
--- a/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp
+++ b/services/inputflinger/benchmarks/InputDispatcher_benchmarks.cpp
@@ -203,9 +203,10 @@
const nsecs_t currentTime = now();
MotionEvent event;
- event.initialize(DEVICE_ID, AINPUT_SOURCE_TOUCHSCREEN, ADISPLAY_ID_DEFAULT,
+ event.initialize(DEVICE_ID, AINPUT_SOURCE_TOUCHSCREEN, ADISPLAY_ID_DEFAULT, INVALID_HMAC,
AMOTION_EVENT_ACTION_DOWN, /* actionButton */ 0, /* flags */ 0,
/* edgeFlags */ 0, AMETA_NONE, /* buttonState */ 0, MotionClassification::NONE,
+ 1 /* xScale */, 1 /* yScale */,
/* xOffset */ 0, /* yOffset */ 0, /* xPrecision */ 0,
/* yPrecision */ 0, AMOTION_EVENT_INVALID_CURSOR_POSITION,
AMOTION_EVENT_INVALID_CURSOR_POSITION, currentTime, currentTime,