summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-03-02 20:49:06 -0800
committerJeff Brown <jeffbrown@google.com>2011-03-02 20:49:06 -0800
commit59fd13c7be1165c957cdf1c6d42f40e4ff7542cf (patch)
tree8c3bf85ddbf669c196fce880ba45ec599cc7827b /libs
parentc9ac3f5183be3f124f34ed49ac5766e0ba1aff77 (diff)
downloadframeworks_base-59fd13c7be1165c957cdf1c6d42f40e4ff7542cf.zip
frameworks_base-59fd13c7be1165c957cdf1c6d42f40e4ff7542cf.tar.gz
frameworks_base-59fd13c7be1165c957cdf1c6d42f40e4ff7542cf.tar.bz2
Only set KeyEvent long press flag when repeat count equals 1.
This fixes a Gingerbread regression. Bug: 3507021 Change-Id: Ia6030665b6a406332adc0ee0d8ee3cb735338c8e
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/InputDispatcher.cpp10
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();