fix(settings): accept a permission mode only for photos
Merged
IM
5d ago+91+91+01234567890123456789-21-21-01234567890123456789
Summary
Every mobile settings permission target accepted the full|limited modes. So an app id typed where --app belongs (settings permission deny notifications com.example.app) was refused as a bad mode, and when the output was discarded the change silently never happened. Only iOS photos honours a mode, and the runtimes already refuse one for every other target.
Now:
photoshas its own form with the modes.- Other targets refuse a fourth positional with "takes no mode".
- On app-scoped targets, a value that looks like a bundle or package id is refused with
reason: setting_permission_app_positional,dispatched: no, the app indetails.app, and the hintPass the app with --app <id>. - The code stays
INVALID_ARGS.
Before / after
Android emulator (Pixel 9 AVD, Android 16):
$ settings permission deny notifications com.android.chrome
base a4f2dcad0: INVALID_ARGS: settings permission mode must be full|limited.
head 1f9f64e1d: INVALID_ARGS: settings permission notifications takes no mode. Not dispatched. Next: Pass the app with --app com.android.chrome.
$ settings permission grant notifications --app com.android.chrome
head: Updated setting: permission
$ settings permission grant accessibility com.android.chrome # macOS-only target, so no --app hint
head: INVALID_ARGS: settings permission accessibility takes no mode.
Validation
- Head
1f9f64e1d,check:affected --run --head,exactCommit: true(same result at0bac0145b). Format, lint, typecheck, layering, fallow, build and vitest-related pass.unitfails only onupload-http-deadlineandcommitted-source-tree, which fail the same way on clean main on this macOS host. - The new
settings.test.tscases fail at base.