summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-11-17 19:16:52 -0800
committerJeff Brown <jeffbrown@google.com>2010-11-17 19:17:54 -0800
commit9bb3ef2e78879e4ec02821fbdb07ba9f9e9521a1 (patch)
treee23887aff5db012d2aea4f31dbd1143ff9fa6d99 /libs/ui
parentbc2e494938131f0aec2f3cebf92d30734224343b (diff)
downloadframeworks_native-9bb3ef2e78879e4ec02821fbdb07ba9f9e9521a1.zip
frameworks_native-9bb3ef2e78879e4ec02821fbdb07ba9f9e9521a1.tar.gz
frameworks_native-9bb3ef2e78879e4ec02821fbdb07ba9f9e9521a1.tar.bz2
Fix stuck keys when released out of order. (DO NOT MERGE)
Bug: 3208156 Change-Id: I14e4d54f4912de5e2fabcd8638120623aa2d16e0
Diffstat (limited to 'libs/ui')
-rw-r--r--libs/ui/InputReader.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/ui/InputReader.cpp b/libs/ui/InputReader.cpp
index d167439..3197ab2 100644
--- a/libs/ui/InputReader.cpp
+++ b/libs/ui/InputReader.cpp
@@ -934,7 +934,7 @@ void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t keyCode,
ssize_t keyDownIndex = findKeyDownLocked(scanCode);
if (keyDownIndex >= 0) {
// key repeat, be sure to use same keycode as before in case of rotation
- keyCode = mLocked.keyDowns.top().keyCode;
+ keyCode = mLocked.keyDowns.itemAt(keyDownIndex).keyCode;
} else {
// key down
mLocked.keyDowns.push();
@@ -949,7 +949,7 @@ void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t keyCode,
ssize_t keyDownIndex = findKeyDownLocked(scanCode);
if (keyDownIndex >= 0) {
// key up, be sure to use same keycode as before in case of rotation
- keyCode = mLocked.keyDowns.top().keyCode;
+ keyCode = mLocked.keyDowns.itemAt(keyDownIndex).keyCode;
mLocked.keyDowns.removeAt(size_t(keyDownIndex));
} else {
// key was not actually down