Skip to content

android: settings permission reset/deny kills the app when the permission was granted — no hint #1796

Description

@thymikee

Surfaced by #1781 A1 (PR #1793) and independently reproduced on API 36 (google_apis_playstore, Pixel 7 profile, fixture targetSdk 36).

settings permission reset|deny <perm> on Android maps to pm revoke (src/platforms/android/settings.ts:154-163; documented at website/docs/docs/commands.md:659). Android kills the app's process whenever a granted runtime permission is revoked — foreground or background — so an agent that grants a permission and then calls reset/deny silently loses its app: the next selector fails with Selector did not match against the launcher, with no hint pointing at the cause. Revoking a not-granted permission is harmless, which is why this only bites in grant→revoke sequences.

Suggested fix (product, small): after pm revoke when the prior state was granted, either (a) return a hint on the result ("revoking a granted permission restarts the app; relaunch with open --relaunch before continuing"), or (b) detect the process death and say so in the response, or (c) document it next to the reset mapping in commands.md. (a)+(c) is probably enough. The e2e scenario in #1793 now relaunches explicitly; this issue is about the agent-facing surface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions