Record last keypress timestamp on physical keyboard while typing
Added method to record keypress timestamp while typing. This will be
used by touchpad to trigger additional palm rejection logic.
Bug: 301055381
Test: atest KeyboardInputMapperUnitTest
Change-Id: I4bbfe4c5fefc687a4901e46c9d4c6f832ec1a245
diff --git a/services/inputflinger/tests/InputMapperTest.cpp b/services/inputflinger/tests/InputMapperTest.cpp
index dac4ea0..787444c 100644
--- a/services/inputflinger/tests/InputMapperTest.cpp
+++ b/services/inputflinger/tests/InputMapperTest.cpp
@@ -80,9 +80,15 @@
}
std::list<NotifyArgs> InputMapperUnitTest::process(int32_t type, int32_t code, int32_t value) {
+ nsecs_t when = systemTime(SYSTEM_TIME_MONOTONIC);
+ return process(when, type, code, value);
+}
+
+std::list<NotifyArgs> InputMapperUnitTest::process(nsecs_t when, int32_t type, int32_t code,
+ int32_t value) {
RawEvent event;
- event.when = systemTime(SYSTEM_TIME_MONOTONIC);
- event.readTime = event.when;
+ event.when = when;
+ event.readTime = when;
event.deviceId = mMapper->getDeviceContext().getEventHubId();
event.type = type;
event.code = code;