…ion wait (#4609)
* fix(android): dispatch helper taps and keys without the global animation wait
The helper's input-tap and key actions injected through the public
UiAutomation.injectInputEvent(event, sync) overload, which syncs window
animations before DOWN and after UP for up to five seconds each. While a
window animation or transition stays pending, every plain press paid up to
ten seconds even though dispatch itself was immediate (#4590). Touch plans
already avoided this since #1356.
Taps and keys now inject through UiAutomationInputDispatcher without the
animation wait. A DOWN the framework refuses reached no window, so it is
cancelled and injected once more with a fresh down time after the
framework's animation sync.
Refs #4590
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(android): scan the whole helper source tree for direct input injection
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(android): report an unavailable animation sync apart from a refused press
Tap and key presses now share PressSequence, an Android-free policy that the
helper's JVM suite tests with a fake injector. A refused start is discarded
and retried once after the animation sync. When the runtime skips the
animation wait but cannot sync separately, the press fails with its own
outcome and error type instead of reporting a refusal. A refused end is not
cancelled, because the injection verifier has already recorded it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(android): state why a refused press end gets no cancel
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(android): release a timed-out press start instead of retrying it
Synchronous injection reports a dispatch timeout and a drop alike as false,
but the dispatcher starts its 30 s deadline when the call enters it, so only
a refusal at least that long after the call can be a timeout. A timed-out
start was enqueued and reaches the receiver, so it is now released (touch:
ACTION_CANCEL, key: ACTION_UP with FLAG_CANCELED) and reported as its own
outcome instead of being followed by a second start.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(android): pin that a timed-out press start fails as a timeout without an end
The outcome-to-exception mapping moves from AutomationCommandHandler into
PressSequence, next to the outcome it maps, so the JVM suite covers it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(android): share one touch event builder and keep typed press outcomes
- Taps and touch plans build their finger events through TouchEvents.
- A dropped start on a runtime that injects through the public overload
fails at once, without a discard, as it did before this change.
- A discard or cancel that throws no longer replaces the press outcome.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(android): bound a press by the host budget and report a refused cancel
A synchronous injection can block until the framework's 30 s deadline, so a
press that waited it out answered after the host's 30 s input timeout and
lost its typed result. The helper now bounds each press by a 40 s budget:
the retry of a dropped start runs only when the animation sync and its own
deadline fit, and an end that does not fit is injected without waiting for
dispatch. The host waits 45 s for helper input; a repo guard keeps that above
the press budget.
A timed-out start whose cancel is refused now says so in its timeout
instead of claiming it was cancelled.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* refactor(android): release every refused press start and bound the retry by the host budget
Replaces the timing-based timeout classification, the cancel-result
outcomes, the async end injection and the helper's fixed press budget with
one rule. Every refused start is released (touch: ACTION_CANCEL, key: a
canceled ACTION_UP), which covers both a dropped start and one that timed
out after delivery. The start is retried at most once, only when the host's
remaining budget, now sent with each input command, still fits the
animation sync and the retry's injection deadline. Fill's tap uses the same
command deadline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(android): derive the helper press budget from the request's remaining deadline
The host now waits for an input command until the earlier of its input cap
and the request's own deadline, and sends the helper that wait less its
answer margin, instead of a fixed budget. A request near its deadline sends
a small budget, so the helper skips a retry it could not finish in time.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(android): run a press without a budget as a no-retry press
A provider-supplied helper can be newer than its host, which then sends no
budgetMs; that press is no longer refused with a JSONException but runs
without a retry. Also states why the retry reserves the sync and the
retried start but not the end, and drops an unused import.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(android): refuse a press whose request has no room for one injection
The host now admits helper input at one point: when the request's remaining
time, less the answer margin, cannot cover one synchronous injection's 30 s
framework deadline, the press is refused with the typed reason
android-input-budget-exhausted before anything reaches the helper, so the
host can never stop waiting mid-injection and tear the shared session down.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(android): name the budget test's catch parameter error
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* docs(android): state what the input timeout covers and why a budget refusal skips the fallback
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(android): admit input on one attempt's cost and check fill's time before typing
The host refused any press whose request had under 35 s left, because its
admission minimum was a full 30 s injection plus the answer margin. It now
admits a press when the remaining wait covers one attempt (2 s) and sends
the helper the wait less the margin, down to zero, which only rules out the
retry. Fill checks once after its focus tap that the accessibility
interaction timeout still fits before entering text, and a helper whose host
sends no budget assumes the older host's 30 s wait.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(android): pin fill's typed refusal when text entry no longer fits
Moves fill's post-tap budget check into requireTextEntryTime, unchanged, so
the helper's JVM suite covers both sides of its 5 s boundary.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Align Android Maestro swipes with the persistent helper architecture.
The PagerView discrepancy came from the public two-argument UiAutomation overload waiting for global animations before every injected event, stretching a 100 ms pan to roughly 10 seconds. The helper now resolves Android's runtime three-argument injection API (
injectInputEvent(event, sync, waitForAnimations=false)) and falls back to the public overload on runtimes where the lookup fails. Per-event dispatch guarantees and event shape are unchanged; it does not restore adb input swipe.Validation