eventhub: print debugginf info when removing device
Change-Id: I40bbbd3867e8c7ac7d6fb38e1c72432bb4963316 Signed-off-by: Dima Zavin <dima@android.com>
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