fix(android): require acknowledgements for test IME typing

Merged
TH
7d ago
+1303-244

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 f265d1f9a0 passed: 42 checks, 25 hosted or parked skips, exactCommit=true. Its first run failed only on vitest-related: two unrelated provider-integration scenarios could not attach to a live daemon, cause unproven. Both pass solo, and one rerun passed. Earlier head f4ad9a57749 had the same receipt.
  • Live run at f4ad9a5774 on 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 type returned ok with commitText code=1.
    • 50,001 UTF-8 bytes gave two code=1 acks. type and fill read back the full text exactly in a multiline field.
    • fill read back exactly, also when the field already held the value.
    • A pre-v2 helper was refused with android_ime_helper_no_ack and the reinstall hint. The field did not change.
    • With no focused editor (tab switch, or a window with no editor), type reports no-input-connection.
    • Logcat had 0 matches for the typed text.
  • Live run at f265d1f9a0 on the same emulator: a test-IME fill whose clear was acked and whose first text chunk got no-input-connection made 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
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.