DescriptionFix android key event timestamps
Pass a Java long to C++ as a jlong type, not a C++ long which can have a
different size to avoid broken / negative event timestamp values.
ImeAdapter's Java side uses "long" in SendKeyEvent, so the C++ side must
use a jlong or int64_t, and not a C++ long. Otherwise things don't work
well when system uptime is over 2^31ms (~25 days).
Additionally, do not do an extra divide-by-1000 when the used helper
function will do the milliseconds to seconds conversion already, so the
timestamps are correctly measured in milliseconds.
The resulting keyboard event timestamps end up nicely sane and positive,
and no longer clamped to 0 in PerformanceBase.cpp.
BUG=701726
R=aelias@chromium.org
Review-Url: https://codereview.chromium.org/2755453004
Cr-Commit-Position: refs/heads/master@{#457369}
Committed: https://chromium.googlesource.com/chromium/src/+/6bda2b55ca3d254ca021560906d0703e8b0df21e
Patch Set 1 #
Total comments: 2
Patch Set 2 : event_time -> time_ms #
Messages
Total messages: 11 (6 generated)
|