Skip to content

Commit e23c235

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "Only set KeyEvent long press flag when repeat count equals 1." into gingerbread
2 parents 611af23 + 59fd13c commit e23c235

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

libs/ui/InputDispatcher.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,6 @@ InputDispatcher::KeyEntry* InputDispatcher::synthesizeKeyRepeatLocked(
592592
// mKeyRepeatState.lastKeyEntry in addition to the one we return.
593593
entry->refCount += 1;
594594

595-
if (entry->repeatCount == 1) {
596-
entry->flags |= AKEY_EVENT_FLAG_LONG_PRESS;
597-
}
598-
599595
mKeyRepeatState.nextRepeatTime = currentTime + keyRepeatDelay;
600596
return entry;
601597
}
@@ -645,6 +641,12 @@ bool InputDispatcher::dispatchKeyLocked(
645641
resetKeyRepeatLocked();
646642
}
647643

644+
if (entry->repeatCount == 1) {
645+
entry->flags |= AKEY_EVENT_FLAG_LONG_PRESS;
646+
} else {
647+
entry->flags &= ~AKEY_EVENT_FLAG_LONG_PRESS;
648+
}
649+
648650
entry->dispatchInProgress = true;
649651
resetTargetsLocked();
650652

0 commit comments

Comments
 (0)