-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
Hi team,
On Android, MediaPicker.CapturePhotoAsync() launches the system camera app via Intent (android.media.action.IMAGE_CAPTURE). Because it’s an Intent handoff, the caller app doesn’t need to hold android.permission.CAMERA. However, MAUI currently treats CAMERA as required, which adds a needless permission prompt and causes Play Store hardware filtering side-effects.
Why this matters
Unnecessary permission friction (privacy + extra runtime prompt).
Play Store filtering: declaring CAMERA implies required back camera + autofocus unless features are explicitly marked optional, which can hide the app from fixed-focus/front-only/Chromebook devices.
Evidence
MAUI source for Android MediaPicker: it builds and launches an Intent (sets MediaStore.ExtraOutput, etc.), not Camera/Camera2:
https://github.com/dotnet/maui/blob/main/src/Essentials/src/MediaPicker/MediaPicker.android.cs
Xamarin.Essentials ancestor shows the same Intent flow:
https://github.com/xamarin/Essentials/blob/main/Xamarin.Essentials/MediaPicker/MediaPicker.android.cs
Android official guidance: for basic capture you can use a camera Intent; you don’t need CAMERA when invoking the existing camera app:
Camera Intents guide: https://developer.android.com/media/camera/camera-intents
Camera API note (“If you are using the camera by invoking an existing camera app, your application does not need to request this permission.”):
https://developer.android.com/media/camera/camera-deprecated/camera-api
MAUI docs also instruct adding a package-visibility query for android.media.action.IMAGE_CAPTURE (a tell that the flow is Intent-based):
https://learn.microsoft.com/dotnet/maui/platform-integration/device-media/picker?view=net-maui-9.0
Request
Make CAMERA optional for the Android MediaPicker capture path, or adjust the implementation/docs so CAMERA isn’t required when using the Intent handoff.
If you keep recommending CAMERA, please also recommend marking features optional to avoid Play filtering:
Environment: .NET MAUI
Thanks!
Public API Changes
No public API change required (docs/templates/analyzer change).
Intended Use-Case
Scenario: Many MAUI apps only need to let the user take a quick photo (receipt, profile pic, document) and don’t need an in-app camera preview or frame access. MediaPicker.CapturePhotoAsync() already does this by launching the system camera app via the android.media.action.IMAGE_CAPTURE Intent and returning a file/URI.
Why not require CAMERA here:
Permission friction & privacy: Asking for camera permission when the app doesn’t operate the camera directly creates unnecessary prompts and user drop-off.
Play Store filtering: Declaring CAMERA can implicitly require back camera and autofocus unless features are explicitly marked optional, which can hide the app from fixed-focus, front-only, or Chromebook devices.
Enterprise/MDM: Some orgs restrict the camera permission entirely, yet they are fine with the OS camera app being used. Intent-only capture works in those environments without requesting CAMERA.
Correctness: In the Intent hand-off model, the camera app holds the camera permission. The calling app doesn’t need it.