Update eventTime to prevent stale events

Generate a new motionevent for each injection to ensure that eventtime
remains up to date.

In the InputDispatcher benchmarks, if the eventTime is not updated, then
the test will be stuck, because dispatcher will just drop all events.
To hit this condition, the benchmark must be ran for a sufficiently long
amount of time so that isStaleEvent returns true.
At that point, the benchmark for injectMotion will be stuck, because all
events are dropped, and we cannot consume anything.

The setDownTime api is unsupportedAppUsage in the Java layer, so we
shouldn't remove it.

Bug: none
Test: flame:/data/benchmarktest64/inputflinger_benchmarks #
./inputflinger_benchmarks --benchmark_min_time=10

Change-Id: I1eb93ca9ddac52562e0da50de355d5cdc584c893
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index 4766bce..26c2d3f 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -252,6 +252,10 @@
     return first->getToken() == second->getToken();
 }
 
+static bool isStaleEvent(nsecs_t currentTime, const EventEntry& entry) {
+    return currentTime - entry.eventTime >= STALE_EVENT_TIMEOUT;
+}
+
 // --- InputDispatcherThread ---
 
 class InputDispatcher::InputDispatcherThread : public Thread {
@@ -743,10 +747,6 @@
 #endif
 }
 
-bool InputDispatcher::isStaleEvent(nsecs_t currentTime, const EventEntry& entry) {
-    return currentTime - entry.eventTime >= STALE_EVENT_TIMEOUT;
-}
-
 bool InputDispatcher::haveCommandsLocked() const {
     return !mCommandQueue.empty();
 }