fix(android): require acknowledgements for test IME typing
Merged
TH
7d ago+1303+1303+0123456789012345678901234567890123456789-244-244-012345678901234567890123456789
Summary
Require an ordered acknowledgement from the Android test IME and split large text on code-point boundaries. The acknowledgement reports attempted UTF-16 length and the editor API result. Fill still verifies the resulting field value through its existing readback.
The v2 receiver returns codes and lengths only. A helper without v2 acknowledgement support refuses typing with a reinstall hint. Bundled helpers upgrade with the CLI. With no focused editor, the helper returns no-input-connection instead of a false success. Refs #4520.
Validation
Base 6e18ea3349685f3cf6cec4c2e6d1104980ab2738; tested head f265d1f9a09f7128379d89f24d6e1e031d8d7b2a.
pnpm check:affected --run --head f265d1f9a0passed: 42 checks, 25 hosted or parked skips,exactCommit=true. Its first run failed only onvitest-related: two unrelated provider-integration scenarios could not attach to a live daemon, cause unproven. Both pass solo, and one rerun passed. Earlier headf4ad9a57749had the same receipt.- Live run at
f4ad9a5774on emulator Pixel_7_CI (Android 16), CLI and helper built from it: https://github.com/callstack/agent-device/pull/4722#issuecomment-7008251594. Later heads change host retry routing and its tests only, so this run still covers the helper.- ASCII and mixed Unicode
typereturned ok withcommitText code=1. - 50,001 UTF-8 bytes gave two
code=1acks.typeandfillread back the full text exactly in a multiline field. fillread back exactly, also when the field already held the value.- A pre-v2 helper was refused with
android_ime_helper_no_ackand the reinstall hint. The field did not change. - With no focused editor (tab switch, or a window with no editor),
typereportsno-input-connection. - Logcat had 0 matches for the typed text.
- ASCII and mixed Unicode
- Live run at
f265d1f9a0on the same emulator: a test-IMEfillwhose clear was acked and whose first text chunk gotno-input-connectionmade one rebind and one recovery attempt, then read back exactly (19 of 19 forced attempts): https://github.com/callstack/agent-device/pull/4722#issuecomment-7010352934 - CI: Coverage fails on main's stale recording-overlay source (fix in #4737), not on this change.
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.