diff options
author | Jeff Brown <jeffbrown@google.com> | 2011-03-02 20:34:30 -0800 |
---|---|---|
committer | Jeff Brown <jeffbrown@google.com> | 2011-03-02 20:34:30 -0800 |
commit | e2e012683d6f35f5eedfd0c39167ea78e32e2650 (patch) | |
tree | 9dc51c3b108de52fd7bc374ae79fa88e930282eb /services/input | |
parent | 55acdf7dcd0cf5b9aacfe48808e98056c7d60e5b (diff) | |
download | frameworks_base-e2e012683d6f35f5eedfd0c39167ea78e32e2650.zip frameworks_base-e2e012683d6f35f5eedfd0c39167ea78e32e2650.tar.gz frameworks_base-e2e012683d6f35f5eedfd0c39167ea78e32e2650.tar.bz2 |
Only set KeyEvent long press flag when repeat count equals 1.
This fixes a Gingerbread regression.
Bug: 3507021
Change-Id: I8c2acb35be718fea7e996175c1407e84315d17ef
Diffstat (limited to 'services/input')
-rw-r--r-- | services/input/InputDispatcher.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/services/input/InputDispatcher.cpp b/services/input/InputDispatcher.cpp index 655b672..0606307 100644 --- a/services/input/InputDispatcher.cpp +++ b/services/input/InputDispatcher.cpp @@ -699,10 +699,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; } @@ -752,6 +748,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(); |