Recover from bad input event timestamps from the kernel.

This can happen due to a race when the input device is
opened or if the kernel happens to be missing the required
Android patches to set the timestamp correctly.

Bug: 7291243
Change-Id: If4319440eaff2889147c86296abd39efc5664346
This commit is contained in:
Jeff Brown
2012-10-05 17:59:56 -07:00
parent f948500239
commit f33b2b2b24
2 changed files with 37 additions and 2 deletions

View File

@@ -956,8 +956,9 @@ void InputDevice::process(const RawEvent* rawEvents, size_t count) {
size_t numMappers = mMappers.size();
for (const RawEvent* rawEvent = rawEvents; count--; rawEvent++) {
#if DEBUG_RAW_EVENTS
ALOGD("Input event: device=%d type=0x%04x code=0x%04x value=0x%08x",
rawEvent->deviceId, rawEvent->type, rawEvent->code, rawEvent->value);
ALOGD("Input event: device=%d type=0x%04x code=0x%04x value=0x%08x when=%lld",
rawEvent->deviceId, rawEvent->type, rawEvent->code, rawEvent->value,
rawEvent->when);
#endif
if (mDropUntilNextSync) {