Merge "Only set KeyEvent long press flag when repeat count equals 1." into gingerbread

This commit is contained in:
Jeff Brown 2011-03-03 14:42:14 -08:00 committed by Android (Google) Code Review
commit 7a1626f037

View File

@ -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();