summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2010-08-19 11:55:13 -0700
committerJeff Brown <jeffbrown@google.com>2010-08-19 13:26:58 -0700
commit0f4d7bc1844af4934a0288e715a4f1350fd5dac2 (patch)
treeb97592a41cd0db3c6758a02dec829dac69ebf51d /libs
parent3d8c9bdbed0c31143227697bd0d94fd234fe08ad (diff)
downloadframeworks_base-0f4d7bc1844af4934a0288e715a4f1350fd5dac2.zip
frameworks_base-0f4d7bc1844af4934a0288e715a4f1350fd5dac2.tar.gz
frameworks_base-0f4d7bc1844af4934a0288e715a4f1350fd5dac2.tar.bz2
Make the throttling more sensitive to end-to-end latency.
The code now takes into account the time when the event was generated. So with a 60Hz throttling rate, it ensures that a motion event will not be delayed due to throttling by any more than 1/60th of second past the time it was generated. Change-Id: Iaea1d4f76e79036b4a18873485230731c3cd63c3
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/InputDispatcher.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/ui/InputDispatcher.cpp b/libs/ui/InputDispatcher.cpp
index ce616a4..e35050c 100644
--- a/libs/ui/InputDispatcher.cpp
+++ b/libs/ui/InputDispatcher.cpp
@@ -201,7 +201,8 @@ void InputDispatcher::dispatchOnce() {
}
#endif
- mThrottleState.lastEventTime = currentTime;
+ mThrottleState.lastEventTime = entry->eventTime < currentTime
+ ? entry->eventTime : currentTime;
mThrottleState.lastDeviceId = deviceId;
mThrottleState.lastSource = source;
}