diff options
Diffstat (limited to 'src/io/appium/droiddriver/actions/TextAction.java')
-rw-r--r-- | src/io/appium/droiddriver/actions/TextAction.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/io/appium/droiddriver/actions/TextAction.java b/src/io/appium/droiddriver/actions/TextAction.java index b108b00..28565e8 100644 --- a/src/io/appium/droiddriver/actions/TextAction.java +++ b/src/io/appium/droiddriver/actions/TextAction.java @@ -59,7 +59,6 @@ public class TextAction extends KeyAction { // TODO: recycle events? KeyEvent[] events = KEY_CHAR_MAP.getEvents(text.toCharArray()); - boolean success = false; if (events != null) { for (KeyEvent event : events) { @@ -69,15 +68,14 @@ public class TextAction extends KeyAction { // possible for an event to become stale before it is injected if it // takes too long to inject the preceding ones. KeyEvent modifiedEvent = KeyEvent.changeTimeRepeat(event, SystemClock.uptimeMillis(), 0); - success = injector.injectInputEvent(modifiedEvent); - if (!success) { - break; + if (!injector.injectInputEvent(modifiedEvent)) { + throw new ActionException("Failed to inject " + event); } } } else { throw new ActionException("The given text is not supported: " + text); } - return success; + return true; } @Override |