summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-09-08 14:34:26 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-08 14:34:26 -0700
commit8723bb58b17a07b7ca036cc76d737c6c0f4b13c7 (patch)
tree0a412f4fc395b2391957faafc42e06c43374dc9c /libs
parent6bb72458f934f00fdfee75323a7919a9f10eba03 (diff)
parentb21fb104cc95fe7e5daf3b3626241e525c39a3f1 (diff)
downloadframeworks_base-8723bb58b17a07b7ca036cc76d737c6c0f4b13c7.zip
frameworks_base-8723bb58b17a07b7ca036cc76d737c6c0f4b13c7.tar.gz
frameworks_base-8723bb58b17a07b7ca036cc76d737c6c0f4b13c7.tar.bz2
am b21fb104: Fix key repeat delay.
Merge commit 'b21fb104cc95fe7e5daf3b3626241e525c39a3f1' into gingerbread-plus-aosp * commit 'b21fb104cc95fe7e5daf3b3626241e525c39a3f1': Fix key repeat delay.
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/InputDispatcher.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp
index e5b7f28..df232d4 100644
--- a/libs/ui/InputDispatcher.cpp
+++ b/libs/ui/InputDispatcher.cpp
@@ -97,6 +97,7 @@ InputDispatcher::~InputDispatcher() {
void InputDispatcher::dispatchOnce() {
nsecs_t keyRepeatTimeout = mPolicy->getKeyRepeatTimeout();
+ nsecs_t keyRepeatDelay = mPolicy->getKeyRepeatDelay();
bool skipPoll = false;
nsecs_t currentTime;
@@ -146,7 +147,7 @@ void InputDispatcher::dispatchOnce() {
if (mInboundQueue.isEmpty()) {
if (mKeyRepeatState.lastKeyEntry) {
if (currentTime >= mKeyRepeatState.nextRepeatTime) {
- processKeyRepeatLockedInterruptible(currentTime, keyRepeatTimeout);
+ processKeyRepeatLockedInterruptible(currentTime, keyRepeatDelay);
skipPoll = true;
} else {
if (mKeyRepeatState.nextRepeatTime < nextWakeupTime) {
@@ -335,7 +336,7 @@ void InputDispatcher::processKeyLockedInterruptible(
}
void InputDispatcher::processKeyRepeatLockedInterruptible(
- nsecs_t currentTime, nsecs_t keyRepeatTimeout) {
+ nsecs_t currentTime, nsecs_t keyRepeatDelay) {
KeyEntry* entry = mKeyRepeatState.lastKeyEntry;
// Search the inbound queue for a key up corresponding to this device.
@@ -352,7 +353,7 @@ void InputDispatcher::processKeyRepeatLockedInterruptible(
}
}
- // Synthesize a key repeat after the repeat timeout expired.
+ // Synthesize a key repeat.
// Reuse the repeated key entry if it is otherwise unreferenced.
uint32_t policyFlags = entry->policyFlags & POLICY_FLAG_RAW_MASK;
if (entry->refCount == 1) {
@@ -375,7 +376,7 @@ void InputDispatcher::processKeyRepeatLockedInterruptible(
entry->flags |= AKEY_EVENT_FLAG_LONG_PRESS;
}
- mKeyRepeatState.nextRepeatTime = currentTime + keyRepeatTimeout;
+ mKeyRepeatState.nextRepeatTime = currentTime + keyRepeatDelay;
#if DEBUG_OUTBOUND_EVENT_DETAILS
LOGD("processKeyRepeat - eventTime=%lld, deviceId=0x%x, source=0x%x, policyFlags=0x%x, "