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/InstrumentedInputReader.h b/services/inputflinger/tests/InstrumentedInputReader.h
index ca85558..e9c7bb4 100644
--- a/services/inputflinger/tests/InstrumentedInputReader.h
+++ b/services/inputflinger/tests/InstrumentedInputReader.h
@@ -106,6 +106,9 @@
void setPreventingTouchpadTaps(bool prevent) override { mPreventingTouchpadTaps = prevent; }
bool isPreventingTouchpadTaps() override { return mPreventingTouchpadTaps; }
+ void setLastKeyDownTimestamp(nsecs_t when) override { mLastKeyDownTimestamp = when; };
+ nsecs_t getLastKeyDownTimestamp() override { return mLastKeyDownTimestamp; };
+
private:
int32_t mGlobalMetaState;
bool mUpdateGlobalMetaStateWasCalled;
@@ -113,6 +116,7 @@
std::optional<nsecs_t> mRequestedTimeout;
std::vector<InputDeviceInfo> mExternalStylusDevices;
bool mPreventingTouchpadTaps{false};
+ nsecs_t mLastKeyDownTimestamp;
} mFakeContext;
friend class InputReaderTest;