diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2010-08-18 13:59:43 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-08-18 13:59:43 -0700 |
commit | 6d5bb88454db2fc798a07ec1085ef55572dbe670 (patch) | |
tree | da9d454eedaf437bacf177d17f150adc58b8ff5b /libs | |
parent | 4195d097c535acf9e1c60b323134fcb5609c18b7 (diff) | |
parent | aac6a7481757e3477e489f311e53385988a5d9a0 (diff) | |
download | frameworks_base-6d5bb88454db2fc798a07ec1085ef55572dbe670.zip frameworks_base-6d5bb88454db2fc798a07ec1085ef55572dbe670.tar.gz frameworks_base-6d5bb88454db2fc798a07ec1085ef55572dbe670.tar.bz2 |
am aac6a748: Merge "Only monitor recognized uevent devices." into gingerbread
Merge commit 'aac6a7481757e3477e489f311e53385988a5d9a0' into gingerbread-plus-aosp
* commit 'aac6a7481757e3477e489f311e53385988a5d9a0':
Only monitor recognized uevent devices.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ui/EventHub.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp index a3c34d0..891661d 100644 --- a/libs/ui/EventHub.cpp +++ b/libs/ui/EventHub.cpp @@ -581,7 +581,6 @@ int EventHub::open_device(const char *deviceName) if (strcmp(name, test) == 0) { LOGI("ignoring event id %s driver %s\n", deviceName, test); close(fd); - fd = -1; return -1; } } @@ -813,6 +812,14 @@ int EventHub::open_device(const char *deviceName) device->id, name, propName, keylayoutFilename); } + // If the device isn't recognized as something we handle, don't monitor it. + if (device->classes == 0) { + LOGV("Dropping device %s %p, id = %d\n", deviceName, device, devid); + close(fd); + delete device; + return -1; + } + LOGI("New device: path=%s name=%s id=0x%x (of 0x%x) index=%d fd=%d classes=0x%x\n", deviceName, name, device->id, mNumDevicesById, mFDCount, fd, device->classes); |