Loading services/inputflinger/EventHub.cpp +1 −27 Original line number Diff line number Diff line Loading @@ -147,8 +147,7 @@ EventHub::Device::Device(int fd, int32_t id, const std::string& path, fd(fd), id(id), path(path), identifier(identifier), classes(0), configuration(nullptr), virtualKeyMap(nullptr), ffEffectPlaying(false), ffEffectId(-1), controllerNumber(0), timestampOverrideSec(0), timestampOverrideUsec(0), enabled(true), isVirtual(fd < 0) { enabled(true), isVirtual(fd < 0) { memset(keyBitmask, 0, sizeof(keyBitmask)); memset(absBitmask, 0, sizeof(absBitmask)); memset(relBitmask, 0, sizeof(relBitmask)); Loading Loading @@ -871,31 +870,6 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz (int) iev.time.tv_sec, (int) iev.time.tv_usec, iev.type, iev.code, iev.value); // Some input devices may have a better concept of the time // when an input event was actually generated than the kernel // which simply timestamps all events on entry to evdev. // This is a custom Android extension of the input protocol // mainly intended for use with uinput based device drivers. if (iev.type == EV_MSC) { if (iev.code == MSC_ANDROID_TIME_SEC) { device->timestampOverrideSec = iev.value; continue; } else if (iev.code == MSC_ANDROID_TIME_USEC) { device->timestampOverrideUsec = iev.value; continue; } } if (device->timestampOverrideSec || device->timestampOverrideUsec) { iev.time.tv_sec = device->timestampOverrideSec; iev.time.tv_usec = device->timestampOverrideUsec; if (iev.type == EV_SYN && iev.code == SYN_REPORT) { device->timestampOverrideSec = 0; device->timestampOverrideUsec = 0; } ALOGV("applied override time %d.%06d", int(iev.time.tv_sec), int(iev.time.tv_usec)); } // Use the time specified in the event instead of the current time // so that downstream code can get more accurate estimates of // event dispatch latency from the time the event is enqueued onto Loading services/inputflinger/EventHub.h +0 −17 Original line number Diff line number Diff line Loading @@ -42,20 +42,6 @@ #define BTN_FIRST 0x100 // first button code #define BTN_LAST 0x15f // last button code /* * These constants are used privately in Android to pass raw timestamps * through evdev from uinput device drivers because there is currently no * other way to transfer this information. The evdev driver automatically * timestamps all input events with the time they were posted and clobbers * whatever information was passed in. * * For the purposes of this hack, the timestamp is specified in the * CLOCK_MONOTONIC timebase and is split into two EV_MSC events specifying * seconds and microseconds. */ #define MSC_ANDROID_TIME_SEC 0x6 #define MSC_ANDROID_TIME_USEC 0x7 namespace android { enum { Loading Loading @@ -371,9 +357,6 @@ private: int32_t controllerNumber; int32_t timestampOverrideSec; int32_t timestampOverrideUsec; Device(int fd, int32_t id, const std::string& path, const InputDeviceIdentifier& identifier); ~Device(); Loading Loading
services/inputflinger/EventHub.cpp +1 −27 Original line number Diff line number Diff line Loading @@ -147,8 +147,7 @@ EventHub::Device::Device(int fd, int32_t id, const std::string& path, fd(fd), id(id), path(path), identifier(identifier), classes(0), configuration(nullptr), virtualKeyMap(nullptr), ffEffectPlaying(false), ffEffectId(-1), controllerNumber(0), timestampOverrideSec(0), timestampOverrideUsec(0), enabled(true), isVirtual(fd < 0) { enabled(true), isVirtual(fd < 0) { memset(keyBitmask, 0, sizeof(keyBitmask)); memset(absBitmask, 0, sizeof(absBitmask)); memset(relBitmask, 0, sizeof(relBitmask)); Loading Loading @@ -871,31 +870,6 @@ size_t EventHub::getEvents(int timeoutMillis, RawEvent* buffer, size_t bufferSiz (int) iev.time.tv_sec, (int) iev.time.tv_usec, iev.type, iev.code, iev.value); // Some input devices may have a better concept of the time // when an input event was actually generated than the kernel // which simply timestamps all events on entry to evdev. // This is a custom Android extension of the input protocol // mainly intended for use with uinput based device drivers. if (iev.type == EV_MSC) { if (iev.code == MSC_ANDROID_TIME_SEC) { device->timestampOverrideSec = iev.value; continue; } else if (iev.code == MSC_ANDROID_TIME_USEC) { device->timestampOverrideUsec = iev.value; continue; } } if (device->timestampOverrideSec || device->timestampOverrideUsec) { iev.time.tv_sec = device->timestampOverrideSec; iev.time.tv_usec = device->timestampOverrideUsec; if (iev.type == EV_SYN && iev.code == SYN_REPORT) { device->timestampOverrideSec = 0; device->timestampOverrideUsec = 0; } ALOGV("applied override time %d.%06d", int(iev.time.tv_sec), int(iev.time.tv_usec)); } // Use the time specified in the event instead of the current time // so that downstream code can get more accurate estimates of // event dispatch latency from the time the event is enqueued onto Loading
services/inputflinger/EventHub.h +0 −17 Original line number Diff line number Diff line Loading @@ -42,20 +42,6 @@ #define BTN_FIRST 0x100 // first button code #define BTN_LAST 0x15f // last button code /* * These constants are used privately in Android to pass raw timestamps * through evdev from uinput device drivers because there is currently no * other way to transfer this information. The evdev driver automatically * timestamps all input events with the time they were posted and clobbers * whatever information was passed in. * * For the purposes of this hack, the timestamp is specified in the * CLOCK_MONOTONIC timebase and is split into two EV_MSC events specifying * seconds and microseconds. */ #define MSC_ANDROID_TIME_SEC 0x6 #define MSC_ANDROID_TIME_USEC 0x7 namespace android { enum { Loading Loading @@ -371,9 +357,6 @@ private: int32_t controllerNumber; int32_t timestampOverrideSec; int32_t timestampOverrideUsec; Device(int fd, int32_t id, const std::string& path, const InputDeviceIdentifier& identifier); ~Device(); Loading