am e8b7f4a2: eventhub: print debugginf info when removing device
* commit 'e8b7f4a20c43d8f55d0cf85a94363b764ba598b8': eventhub: print debugginf info when removing device
This commit is contained in:
@@ -639,6 +639,8 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz
|
|||||||
sizeof(struct input_event) * capacity);
|
sizeof(struct input_event) * capacity);
|
||||||
if (readSize == 0 || (readSize < 0 && errno == ENODEV)) {
|
if (readSize == 0 || (readSize < 0 && errno == ENODEV)) {
|
||||||
// Device was removed before INotify noticed.
|
// 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;
|
deviceChanged = true;
|
||||||
closeDeviceLocked(device);
|
closeDeviceLocked(device);
|
||||||
} else if (readSize < 0) {
|
} else if (readSize < 0) {
|
||||||
@@ -1254,6 +1256,7 @@ status_t EventHub::readNotifyLocked() {
|
|||||||
if(event->mask & IN_CREATE) {
|
if(event->mask & IN_CREATE) {
|
||||||
openDeviceLocked(devname);
|
openDeviceLocked(devname);
|
||||||
} else {
|
} else {
|
||||||
|
LOGI("Removing device '%s' due to inotify event\n", devname);
|
||||||
closeDeviceByPathLocked(devname);
|
closeDeviceByPathLocked(devname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user