summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorMike Lockwood <lockwood@android.com>2009-07-17 00:10:10 -0400
committerMike Lockwood <lockwood@android.com>2009-07-17 00:10:10 -0400
commit15431a9482cedcfee7f5badc05c436e2c7cc7997 (patch)
tree687e109cd0069a3e417c4b472130a90179430bd3 /libs/ui
parent265c9d2a147fba80629dda9d28ec9c68de24278e (diff)
downloadframeworks_base-15431a9482cedcfee7f5badc05c436e2c7cc7997.zip
frameworks_base-15431a9482cedcfee7f5badc05c436e2c7cc7997.tar.gz
frameworks_base-15431a9482cedcfee7f5badc05c436e2c7cc7997.tar.bz2
EventHub: Compare name instead of id when excluding event input devices.
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'libs/ui')
-rw-r--r--libs/ui/EventHub.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp
index 402bce2..59c9476 100644
--- a/libs/ui/EventHub.cpp
+++ b/libs/ui/EventHub.cpp
@@ -509,28 +509,29 @@ int EventHub::open_device(const char *deviceName)
//fprintf(stderr, "could not get device name for %s, %s\n", deviceName, strerror(errno));
name[0] = '\0';
}
- if(ioctl(fd, EVIOCGPHYS(sizeof(location) - 1), &location) < 1) {
- //fprintf(stderr, "could not get location for %s, %s\n", deviceName, strerror(errno));
- location[0] = '\0';
- }
- if(ioctl(fd, EVIOCGUNIQ(sizeof(idstr) - 1), &idstr) < 1) {
- //fprintf(stderr, "could not get idstring for %s, %s\n", deviceName, strerror(errno));
- idstr[0] = '\0';
- }
// check to see if the device is on our excluded list
List<String8>::iterator iter = mExcludedDevices.begin();
List<String8>::iterator end = mExcludedDevices.end();
for ( ; iter != end; iter++) {
- const char* name = *iter;
- if (strcmp(name, idstr) == 0) {
- LOGD("ignoring event id %s driver %s\n", deviceName, name);
+ const char* test = *iter;
+ if (strcmp(name, test) == 0) {
+ LOGI("ignoring event id %s driver %s\n", deviceName, test);
close(fd);
fd = -1;
return -1;
}
}
+ if(ioctl(fd, EVIOCGPHYS(sizeof(location) - 1), &location) < 1) {
+ //fprintf(stderr, "could not get location for %s, %s\n", deviceName, strerror(errno));
+ location[0] = '\0';
+ }
+ if(ioctl(fd, EVIOCGUNIQ(sizeof(idstr) - 1), &idstr) < 1) {
+ //fprintf(stderr, "could not get idstring for %s, %s\n", deviceName, strerror(errno));
+ idstr[0] = '\0';
+ }
+
int devid = 0;
while (devid < mNumDevicesById) {
if (mDevicesById[devid].device == NULL) {