Skip to content

fix(e2e): use documented hide_error_dialogs ADB setting#359

Merged
cursor[bot] merged 1 commit into
harden-native-modulesfrom
cursor/fix-adb-anr-settings-5cc7
Jun 30, 2026
Merged

fix(e2e): use documented hide_error_dialogs ADB setting#359
cursor[bot] merged 1 commit into
harden-native-modulesfrom
cursor/fix-adb-anr-settings-5cc7

Conversation

@plrthink

Copy link
Copy Markdown
Collaborator

Addresses Devin review comment on PR #358.

Issue

The three adb shell settings put commands added in #358 may be no-ops on API 29:

  • show_anr_messages (secure) — not a documented AOSP key
  • anr_dialogs_disabled (global, value true) — not documented; string true vs int 1 is also suspect
  • anr_show_background (global) — not documented

settings put succeeds even for unrecognized keys, so these gave false confidence without actually suppressing dialogs.

Fix

Use the documented AOSP setting instead:

adb shell settings put global hide_error_dialogs 1

This maps to Settings.Global.HIDE_ERROR_DIALOGS, which ActivityManager reads via getInt() 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.yaml remains as the fallback for any dialog that still appears.

Open in Web Open in Cursor 

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>
@cursor cursor Bot marked this pull request as ready for review June 30, 2026 03:31
@cursor cursor Bot merged commit 1a7b678 into harden-native-modules Jun 30, 2026
@cursor cursor Bot deleted the cursor/fix-adb-anr-settings-5cc7 branch June 30, 2026 03:31

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread .github/workflows/e2e.yml
Comment on lines +208 to +212
# 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 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.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants