summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2011-03-17 01:34:19 -0700
committerJeff Brown <jeffbrown@android.com>2011-05-23 17:20:42 -0700
commit68d6075b4ad2205c10064c78cde552e3210cca91 (patch)
treea8f8e79d5bddb76dd0578a02c17646a05021bbd9 /include
parent5b2b4d9c0a56c4b5e869c828a6c36a1b9e27d61b (diff)
downloadframeworks_base-68d6075b4ad2205c10064c78cde552e3210cca91.zip
frameworks_base-68d6075b4ad2205c10064c78cde552e3210cca91.tar.gz
frameworks_base-68d6075b4ad2205c10064c78cde552e3210cca91.tar.bz2
Refactor how timeouts are calculated. (DO NOT MERGE)
Added a timeout mechanism to EventHub and InputReader so that InputMappers can request timeouts to perform delayed processing of input when needed. Change-Id: I89c1171c9326c6e413042e3ee13aa9f7f1fc0454
Diffstat (limited to 'include')
-rw-r--r--include/utils/Timers.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/utils/Timers.h b/include/utils/Timers.h
index 9a9e07c..8b4d322 100644
--- a/include/utils/Timers.h
+++ b/include/utils/Timers.h
@@ -88,6 +88,16 @@ nsecs_t systemTime(int clock = SYSTEM_TIME_MONOTONIC);
nsecs_t systemTime(int clock);
#endif // def __cplusplus
+/**
+ * Returns the number of milliseconds to wait between the reference time and the timeout time.
+ * If the timeout is in the past relative to the reference time, returns 0.
+ * If the timeout is more than INT_MAX milliseconds in the future relative to the reference time,
+ * such as when timeoutTime == LLONG_MAX, returns -1 to indicate an infinite timeout delay.
+ * Otherwise, returns the difference between the reference time and timeout time
+ * rounded up to the next millisecond.
+ */
+int toMillisecondTimeoutDelay(nsecs_t referenceTime, nsecs_t timeoutTime);
+
#ifdef __cplusplus
} // extern "C"
#endif