am e8b7f4a2: eventhub: print debugginf info when removing device

* commit 'e8b7f4a20c43d8f55d0cf85a94363b764ba598b8':
  eventhub: print debugginf info when removing device
This commit is contained in:
Dima Zavin
2011-09-29 14:06:38 -07:00
committed by Android Git Automerger

View File

@@ -639,6 +639,8 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz
sizeof(struct input_event) * capacity);
if (readSize == 0 || (readSize < 0 && errno == ENODEV)) {
// Device was removed before INotify noticed.
LOGW("could not get event, removed? (fd: %d size: %d bufferSize: %d capacity: %d errno: %d)\n",
device->fd, readSize, bufferSize, capacity, errno);
deviceChanged = true;
closeDeviceLocked(device);
} else if (readSize < 0) {
@@ -1254,6 +1256,7 @@ status_t EventHub::readNotifyLocked() {
if(event->mask & IN_CREATE) {
openDeviceLocked(devname);
} else {
LOGI("Removing device '%s' due to inotify event\n", devname);
closeDeviceByPathLocked(devname);
}
}