diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2011-11-11 16:50:21 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2011-11-11 16:50:25 -0800 |
commit | f434e37945c752a3f92fe6e9941805d612159bdb (patch) | |
tree | 3d3204b035bf9447361e13dc74473f3e211ff5e2 | |
parent | c350f1604f348dceec28ba0d7e4cfc293333f797 (diff) | |
download | frameworks_base-f434e37945c752a3f92fe6e9941805d612159bdb.zip frameworks_base-f434e37945c752a3f92fe6e9941805d612159bdb.tar.gz frameworks_base-f434e37945c752a3f92fe6e9941805d612159bdb.tar.bz2 |
Added missing comments in Instrumentation#sendStringSync
Change-Id: Ib20c5f9763c4ff97dec02fbb79721da93e964bc7
-rw-r--r-- | core/java/android/app/Instrumentation.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java index b607daf..c037ffb 100644 --- a/core/java/android/app/Instrumentation.java +++ b/core/java/android/app/Instrumentation.java @@ -838,6 +838,11 @@ public class Instrumentation { if (events != null) { for (int i = 0; i < events.length; i++) { + // We have to change the time of an event before injecting it because + // all KeyEvents returned by KeyCharacterMap.getEvents() have the same + // time stamp and the system rejects too old events. Hence, it is + // possible for an event to become stale before it is injected if it + // takes too long to inject the preceding ones. sendKeySync(KeyEvent.changeTimeRepeat(events[i], SystemClock.uptimeMillis(), 0)); } } |