fix(android): stop closing foreign apps during recording dialog recovery

TH
12m ago
+677-795

Summary

During a recording, a separate recovery tapped Close app on any Android ANR dialog, including another app's. It ran before type and every generic-route command, which contradicts #592 and #5115. The recovery is deleted. The blocking-dialog guard has no recording condition, so it now also covers recording. The guard is hardened:

  • The ANR title's process, including any :suffix, is resolved to its owning package through dumpsys activity processes. If no single package owns it, the ANR is refused.
  • Close app is tapped only next to the ANR's Wait button. The relaunch waits until a complete capture shows Wait gone.

Unanswered focus probes keep main's behavior. app-switcher, screenshot, and telephony stay unguarded.

Before / after

scroll or type while recording, with another app's ANR in focus:

  • Before: the foreign app is closed, then the command runs.
  • After: COMMAND_FAILED with the alert dismiss hint. Nothing is tapped.

ANR in com.example.app:worker:

  • Before: refused.
  • After: recovered when com.example.app owns that process.

Validation

At e9259bc, the focused vitest files pass: the platform-android suite, the daemon dialog/type/router/gesture suites, and all Android provider scenarios, with capture counts and the long-press ledger at main's values. Live API 37 recovery and refusal evidence is in a PR comment. CI is pending.

🤖 Generated with Claude Code