diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index 05b1a9cb9..e99f762b9 100644 --- a/services/inputflinger/InputReader.cpp +++ b/services/inputflinger/InputReader.cpp @@ -2041,6 +2041,10 @@ void KeyboardInputMapper::configureParameters() { if (mParameters.orientationAware) { mParameters.hasAssociatedDisplay = true; } + + mParameters.handlesKeyRepeat = false; + getDevice()->getConfiguration().tryGetProperty(String8("keyboard.handlesKeyRepeat"), + mParameters.handlesKeyRepeat); } void KeyboardInputMapper::dumpParameters(String8& dump) { @@ -2049,6 +2053,8 @@ void KeyboardInputMapper::dumpParameters(String8& dump) { toString(mParameters.hasAssociatedDisplay)); dump.appendFormat(INDENT4 "OrientationAware: %s\n", toString(mParameters.orientationAware)); + dump.appendFormat(INDENT4 "HandlesKeyRepeat: %s\n", + toString(mParameters.handlesKeyRepeat)); } void KeyboardInputMapper::reset(nsecs_t when) { @@ -2166,6 +2172,10 @@ void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t keyCode, policyFlags |= POLICY_FLAG_WAKE_DROPPED; } + if (mParameters.handlesKeyRepeat) { + policyFlags |= POLICY_FLAG_DISABLE_KEY_REPEAT; + } + if (metaStateChanged) { getContext()->updateGlobalMetaState(); } diff --git a/services/inputflinger/InputReader.h b/services/inputflinger/InputReader.h index c1ce5f7c5..9e36e353a 100644 --- a/services/inputflinger/InputReader.h +++ b/services/inputflinger/InputReader.h @@ -1086,6 +1086,7 @@ private: struct Parameters { bool hasAssociatedDisplay; bool orientationAware; + bool handlesKeyRepeat; } mParameters; void configureParameters();