Disable key repeat when it is switched off
Read whether key repeats are disabled via settings and disable
generation of key repeats if so.
Bug: 336585002
Test: atest InputDispatcherKeyRepeatTest
Test: atest InputManagerServiceTests
Flag: com.android.input.flags.keyboard_repeat_keys
Change-Id: I871bbfc0808bde4a6f85b7ea47ea92d4e80156c7
diff --git a/services/inputflinger/dispatcher/include/InputDispatcherInterface.h b/services/inputflinger/dispatcher/include/InputDispatcherInterface.h
index 653f595..463a952 100644
--- a/services/inputflinger/dispatcher/include/InputDispatcherInterface.h
+++ b/services/inputflinger/dispatcher/include/InputDispatcherInterface.h
@@ -227,10 +227,11 @@
virtual void cancelCurrentTouch() = 0;
/*
- * Updates key repeat configuration timeout and delay.
+ * Updates whether key repeat is enabled and key repeat configuration timeout and delay.
*/
virtual void setKeyRepeatConfiguration(std::chrono::nanoseconds timeout,
- std::chrono::nanoseconds delay) = 0;
+ std::chrono::nanoseconds delay,
+ bool keyRepeatEnabled) = 0;
/*
* Determine if a pointer from a device is being dispatched to the given window.