From fcb39240b15402c2f5e4ba6fe91c916e9a6039f1 Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Wed, 21 Oct 2009 23:01:07 -0400 Subject: [PATCH] Disable key repeats when the screen is off. This prevents an endless stream of key repeats spamming the keyguard if a volume key is pressed at the same time you turn off the screen with the power button. This is part of a fix for bug b/2198537 Change-Id: I0d7e335fee79cbebba96b2cd908458c3c94c839e Signed-off-by: Mike Lockwood --- .../com/android/internal/policy/impl/PhoneWindowManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/policy/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/com/android/internal/policy/impl/PhoneWindowManager.java index 4699638bb1045..d376341df618c 100755 --- a/policy/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/com/android/internal/policy/impl/PhoneWindowManager.java @@ -2218,5 +2218,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { mPowerManager.userActivity(curTime, false, LocalPowerManager.OTHER_EVENT); } } + + public boolean allowKeyRepeat() { + // disable key repeat when screen is off + return mScreenOn; + } }