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

Commit 3d0ea72d authored by Mike Lockwood's avatar Mike Lockwood
Browse files

Add WindowManagerPolicy.allowKeyRepeat() method for disabling key repeats.



Part of a fix for bug b/2198537

Change-Id: I99dc64772fa7644b12432d5549603025196ea3e2
Signed-off-by: default avatarMike Lockwood <lockwood@android.com>
parent f003c0c1
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -868,4 +868,9 @@ public interface WindowManagerPolicy {
     * requesting this is no longer visible.
     */
    public void screenOnStoppedLw();

    /**
     * Return false to disable key repeat events from being generated.
     */
    public boolean allowKeyRepeat();
}
+7 −0
Original line number Diff line number Diff line
@@ -6227,6 +6227,13 @@ public class WindowManagerService extends IWindowManager.Stub
                    lt.sample("2 got event              ", System.nanoTime() - ev.whenNano);
                }

                if (lastKey != null && !mPolicy.allowKeyRepeat()) {
                    // cancel key repeat at the request of the policy.
                    lastKey = null;
                    downTime = 0;
                    lastKeyTime = curTime;
                    nextKeyTime = curTime + LONG_WAIT;
                }
                try {
                    if (ev != null) {
                        curTime = SystemClock.uptimeMillis();