perf(android): share one helper generation across an app-less fill
Summary
An app-less fill uses command scope. Before this change, each hierarchy read in the fill (the pre-read and every verification sample) started the snapshot helper and then stopped it. A point fill with two settled samples paid 3 helper start/stop cycles.
Now fillAndroid holds the helper generation its reads start (holdAndroidSnapshotHelperSessionForOperation in the lifecycle owner) and stops it in finally.
- Each read is still a fresh capture.
- Other commands on the device piggyback on the held helper as on any live session. They start no competing instrumentation.
- The fill's own input stays off the held helper. Outside a daemon session it skips helper input and sends the focus tap with
channel: 'adb-shell'. Provider-native precedence and the no-replay rule are unchanged. - Overlapping fills share one hold. A generation another owner started keeps running.
Before / after
App-less point fill with two settled samples: 3 helper starts and stops before, 1 after. The field result and the input channel do not change.
Validation
text-input-fill-helper-lifecycle.test.ts covers one start and one stop, 3 fresh captures, the shell channel kept for focus and text, a concurrent read and tap reusing the held helper, daemon-session helper input, provider-native precedence, no replay, cleanup on error and on cancellation, and another owner's generation. These tests fail if the global hiding comes back or if the fill's input gate is removed. snapshot.test.ts and text-input-fill.test.ts pass locally. CI pending. No live device run.
š¤ Generated with Claude Code