summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-10-21 15:46:03 -0700
committerKenny Root <kroot@google.com>2010-10-21 15:46:03 -0700
commitbc9c82fb7960b99d6c21839b337360fbf6f8d9a5 (patch)
tree8132cda721524b032d89f413bc970ec92997afff /libs
parente739a5257d7c02b987d9b16046407797f83d1a7d (diff)
downloadframeworks_native-bc9c82fb7960b99d6c21839b337360fbf6f8d9a5.zip
frameworks_native-bc9c82fb7960b99d6c21839b337360fbf6f8d9a5.tar.gz
frameworks_native-bc9c82fb7960b99d6c21839b337360fbf6f8d9a5.tar.bz2
Use correct size of GAMEPAD_KEYCODES
Compute the actual number of indices in the GAMEPAD_KEYCODES instead of the pure size in bytes. Bug: 3121536 Change-Id: I71edbd8bf6eff2c8cc0ea5c6845362b3d1e06466
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/EventHub.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp
index 944731d..5c618fb 100644
--- a/libs/ui/EventHub.cpp
+++ b/libs/ui/EventHub.cpp
@@ -818,7 +818,7 @@ int EventHub::openDevice(const char *deviceName) {
}
// See if this device has a gamepad.
- for (size_t i = 0; i < sizeof(GAMEPAD_KEYCODES); i++) {
+ for (size_t i = 0; i < sizeof(GAMEPAD_KEYCODES)/sizeof(GAMEPAD_KEYCODES[0]); i++) {
if (hasKeycodeLocked(device, GAMEPAD_KEYCODES[i])) {
device->classes |= INPUT_DEVICE_CLASS_GAMEPAD;
break;