diff --git a/services/inputflinger/EventHub.cpp b/services/inputflinger/EventHub.cpp index ce5627271..a0ecc115a 100644 --- a/services/inputflinger/EventHub.cpp +++ b/services/inputflinger/EventHub.cpp @@ -33,7 +33,7 @@ #define LOG_TAG "EventHub" -// #define LOG_NDEBUG 0 +#define LOG_NDEBUG 0 #include "EventHub.h" @@ -885,6 +885,7 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz } } + ALOGI("===> traceKey D7, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); // Grab the next input event. bool deviceChanged = false; while (mPendingEventIndex < mPendingEventCount) { @@ -941,27 +942,34 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz } continue; } + + ALOGI("===> traceKey D6, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); // This must be an input event if (eventItem.events & EPOLLIN) { int32_t readSize = read(device->fd, readBuffer, sizeof(struct input_event) * capacity); + ALOGI("===> traceKey D6-1, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); if (readSize == 0 || (readSize < 0 && errno == ENODEV)) { // Device was removed before INotify noticed. ALOGW("could not get event, removed? (fd: %d size: %" PRId32 " bufferSize: %zu capacity: %zu errno: %d)\n", device->fd, readSize, bufferSize, capacity, errno); + ALOGI("===> traceKey D6-1a, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); deviceChanged = true; closeDeviceLocked(device); } else if (readSize < 0) { + ALOGI("===> traceKey D6-1b, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); if (errno != EAGAIN && errno != EINTR) { ALOGW("could not get event (errno=%d)", errno); } } else if ((readSize % sizeof(struct input_event)) != 0) { + ALOGI("===> traceKey D6-1c, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); ALOGE("could not get event (wrong size: %d)", readSize); } else { int32_t deviceId = device->id == mBuiltInKeyboardId ? 0 : device->id; size_t count = size_t(readSize) / sizeof(struct input_event); + ALOGI("===> traceKey D6-1d, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); for (size_t i = 0; i < count; i++) { struct input_event& iev = readBuffer[i]; event->when = processEventTimestamp(iev); @@ -973,6 +981,7 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz capacity -= 1; } if (capacity == 0) { + ALOGI("===> traceKey D6-1d buffer full, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); // The result buffer is full. Reset the pending event index // so we will try to read the device again on the next iteration. mPendingEventIndex -= 1; @@ -980,16 +989,19 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz } } } else if (eventItem.events & EPOLLHUP) { + ALOGI("===> traceKey D6-2, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); ALOGI("Removing device %s due to epoll hang-up event.", device->identifier.name.c_str()); deviceChanged = true; closeDeviceLocked(device); } else { + ALOGI("===> traceKey D6-3, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); ALOGW("Received unexpected epoll event 0x%08x for device %s.", eventItem.events, device->identifier.name.c_str()); } } + ALOGI("===> traceKey D5, in getEvents, in %s of %s line %d" ,__func__ ,__FILE__ ,__LINE__); // readNotify() will modify the list of devices so this must be done after // processing all other events to ensure that we read all remaining events // before closing the devices.