Fix incorrect repeatCount sent to app when injecting repeat event

When the injected repeat event occurs after the repeat event synthesized
by the InputDispatcher, the repeatCount of the event sent to the app is
incorrect. For example, the repeatCount sequence of the event received
by the app might be 0,1,2,1,2,3,4,....

Test: atest inputflinger_tests
Change-Id: I13574a77896583bb0062bab17395d27585315e6b
diff --git a/services/inputflinger/dispatcher/InputDispatcher.cpp b/services/inputflinger/dispatcher/InputDispatcher.cpp
index 057b996..d06881d 100644
--- a/services/inputflinger/dispatcher/InputDispatcher.cpp
+++ b/services/inputflinger/dispatcher/InputDispatcher.cpp
@@ -1780,7 +1780,7 @@
                                         DropReason* dropReason, nsecs_t& nextWakeupTime) {
     // Preprocessing.
     if (!entry->dispatchInProgress) {
-        if (entry->repeatCount == 0 && entry->action == AKEY_EVENT_ACTION_DOWN &&
+        if (!entry->syntheticRepeat && entry->action == AKEY_EVENT_ACTION_DOWN &&
             (entry->policyFlags & POLICY_FLAG_TRUSTED) &&
             (!(entry->policyFlags & POLICY_FLAG_DISABLE_KEY_REPEAT))) {
             if (mKeyRepeatState.lastKeyEntry &&