fix(e2e): use documented hide_error_dialogs ADB setting#359
Conversation
Replace non-standard adb settings keys (show_anr_messages, anr_dialogs_disabled, anr_show_background) that may be no-ops on the API 29 emulator with Settings.Global.HIDE_ERROR_DIALOGS, the AOSP key used by CTS ANR tests to suppress system error dialogs. Addresses Devin review on PR #358. Co-authored-by: Perry <plrthink@gmail.com>
| # low-memory GitHub Actions emulator. hide_error_dialogs is the | ||
| # documented AOSP global setting (Settings.Global.HIDE_ERROR_DIALOGS) | ||
| # used by CTS/Input ANR tests to suppress error dialogs on API 29+. | ||
| # Maestro still dismisses any dialog that slips through (_setup.yaml). | ||
| adb shell settings put global hide_error_dialogs 1 |
There was a problem hiding this comment.
🚩 Narrower ANR suppression scope compared to the old approach
The old code set three separate settings (show_anr_messages, anr_dialogs_disabled, anr_show_background) which were informal/undocumented and may have targeted different dialog types. The new single setting hide_error_dialogs (Settings.Global.HIDE_ERROR_DIALOGS) is a documented AOSP flag that suppresses all error dialogs (ANR + crash), but it is a single coarse-grained flag rather than three fine-grained ones. In practice this should be equivalent or better for CI purposes, and the Maestro _setup.yaml:74-89 fallback loop that taps "Wait" on any visible ANR dialog provides a safety net. Worth confirming via a CI run that the Expo variant doesn't still see ANR dialogs slipping through, since the old settings were likely added in response to real flakiness.
Was this helpful? React with 👍 or 👎 to provide feedback.
Addresses Devin review comment on PR #358.
Issue
The three
adb shell settings putcommands added in #358 may be no-ops on API 29:show_anr_messages(secure) — not a documented AOSP keyanr_dialogs_disabled(global, valuetrue) — not documented; stringtruevs int1is also suspectanr_show_background(global) — not documentedsettings putsucceeds even for unrecognized keys, so these gave false confidence without actually suppressing dialogs.Fix
Use the documented AOSP setting instead:
This maps to
Settings.Global.HIDE_ERROR_DIALOGS, which ActivityManager reads viagetInt()to suppress system error dialogs (including ANR). It is used by Android CTS ANR tests and works on API 29+.The Maestro repeat loop in
_setup.yamlremains as the fallback for any dialog that still appears.