diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-03-03 15:03:26 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-03-03 15:03:26 -0800 |
commit | 9503e8bc17d72d16631e8d79e8d1c29702fc1e42 (patch) | |
tree | 731b50e270d6be8d91bcfa2dbe922931b8b83f39 /libs | |
parent | d948b85dc9d0362a2ba0f7a3b905be0107a948f4 (diff) | |
parent | e23c235c662c3028cfb080c6ed60d7defcdd0b69 (diff) | |
download | frameworks_base-9503e8bc17d72d16631e8d79e8d1c29702fc1e42.zip frameworks_base-9503e8bc17d72d16631e8d79e8d1c29702fc1e42.tar.gz frameworks_base-9503e8bc17d72d16631e8d79e8d1c29702fc1e42.tar.bz2 |
am e23c235c: Merge "Only set KeyEvent long press flag when repeat count equals 1." into gingerbread
* commit 'e23c235c662c3028cfb080c6ed60d7defcdd0b69':
Only set KeyEvent long press flag when repeat count equals 1.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ui/InputDispatcher.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp index 421ad663..46baf9d 100644 --- a/libs/ui/InputDispatcher.cpp +++ b/libs/ui/InputDispatcher.cpp @@ -592,10 +592,6 @@ InputDispatcher::KeyEntry* InputDispatcher::synthesizeKeyRepeatLocked( // mKeyRepeatState.lastKeyEntry in addition to the one we return. entry->refCount += 1; - if (entry->repeatCount == 1) { - entry->flags |= AKEY_EVENT_FLAG_LONG_PRESS; - } - mKeyRepeatState.nextRepeatTime = currentTime + keyRepeatDelay; return entry; } @@ -645,6 +641,12 @@ bool InputDispatcher::dispatchKeyLocked( resetKeyRepeatLocked(); } + if (entry->repeatCount == 1) { + entry->flags |= AKEY_EVENT_FLAG_LONG_PRESS; + } else { + entry->flags &= ~AKEY_EVENT_FLAG_LONG_PRESS; + } + entry->dispatchInProgress = true; resetTargetsLocked(); |