perf(android): reuse live helper for input and capture

Merged
TH
9h ago
+2284-190

Summary

Reuse the live Android helper for input, verified fill, focus, and PNG capture. Uncertain mutations fail without a resend. Validated no-injection refusals and failed reads stop the helper before using the host path. Dead sessions retire before piggyback commands. Duplicate resource IDs retain live point reads within the requested package/class.

agent-device screenshot screen.png --normalize-status-bar

Historical original-app measurements: tap p50 120→67.7 ms, fill 972→760 ms, screenshot 1448→311 ms; 42/42 cases on both variants. Cases and method. These precede the review fixes.

55 files: production +620/−181; tests +670/−5; docs +994/−4; 2,474 gross lines. Scope includes the evidenced live-text and Android TV fixture fixes. Reference: e2e#1234. Follow-up: #3815; adapter #1253 needs an SDK release.

Validation

Final 1977e685b2, rebased onto main a661e43d83: Affected gate passed: 16,388 tests passed, one skipped; receipt run-gWuy8f, exactCommit=true, checkoutChanged=false. Cancellable tap/back calls retain the upstream host path; ordinary input retains helper reuse. Independent rebase review passed.

New regressions: original 0d4b58c341 8 failed/5 passed; fixed runtime all 13 passed. Two live-helper signal-forwarding cases and 56 focused input/alert tests passed. Live API 36: real fill refusal→ADB success and controlled screenshot protocol failure→valid screencap PNG, with both fallback diagnostics. Independent reviews passed after corrections.

Physical devices, older APIs, Appium, and actual-head CI coverage/native/device/provider lanes remain separate obligations.

Fresh combined-stack benchmark: original 335.069→current 273.989 s (18.2% reduction); pre-daemon 282.000 s. All 42 passed, one authored skip, zero retries/recoveries. One local run per arm.