Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 093ea92a authored by Prabir Pradhan's avatar Prabir Pradhan Committed by Android (Google) Code Review
Browse files

Merge "Decouple key_repeat_timeout and long_press_timeout" into main

parents 4e884178 51289496
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -87,6 +87,13 @@ public class ViewConfiguration {
     */
    private static final int DEFAULT_MULTI_PRESS_TIMEOUT = 300;

    /**
     * Defines the default duration in milliseconds between a key being pressed and its first key
     * repeat event being generated. Historically, Android used the long press timeout as the
     * key repeat timeout, so its default value is set to long press timeout's default.
     */
    private static final int DEFAULT_KEY_REPEAT_TIMEOUT_MS = DEFAULT_LONG_PRESS_TIMEOUT;

    /**
     * Defines the default duration between successive key repeats in milliseconds.
     */
@@ -719,11 +726,8 @@ public class ViewConfiguration {
     * @return the time before the first key repeat in milliseconds.
     */
    public static int getKeyRepeatTimeout() {
        // Before the key repeat timeout was introduced, some users relied on changing
        // LONG_PRESS_TIMEOUT settings to also change the key repeat timeout. To support
        // this backward compatibility, we'll use the long press timeout as default value.
        return AppGlobals.getIntCoreSetting(Settings.Secure.KEY_REPEAT_TIMEOUT_MS,
                getLongPressTimeout());
                DEFAULT_KEY_REPEAT_TIMEOUT_MS);
    }

    /**