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

Part of a fix for bug b/2198537

Change-Id: I99dc64772fa7644b12432d5549603025196ea3e2
Signed-off-by: Mike Lockwood <lockwood@android.com>
This commit is contained in:
Mike Lockwood
2009-10-21 22:58:29 -04:00
parent f003c0c15d
commit 3d0ea72dd7
2 changed files with 12 additions and 0 deletions

View File

@@ -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();