Skip to content

Stop requesting broad Android media/storage permissions - #6740

Merged
FeodorFitsner merged 1 commit into
mainfrom
fix/android-media-permissions
Jul 30, 2026
Merged

Stop requesting broad Android media/storage permissions#6740
FeodorFitsner merged 1 commit into
mainfrom
fix/android-media-permissions

Conversation

@FeodorFitsner

@FeodorFitsner FeodorFitsner commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Google Play's Photo and Video Permissions policy rejects apps targeting API 33+ that declare READ_MEDIA_IMAGES / READ_MEDIA_VIDEO when the system pickers are sufficient, and it flags the legacy *_EXTERNAL_STORAGE permissions when they are unbounded. Flet was handing these out by default in three places.

Changes

flet-cli — the microphone cross-platform permission bundle injected READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE alongside RECORD_AUDIO, so every app built with --permissions microphone got broad storage access it never asked for. Recording only needs RECORD_AUDIO; recordings go to app-scoped storage.

client — dropped READ_MEDIA_AUDIO, READ_MEDIA_VIDEO and both *_EXTERNAL_STORAGE from the Android manifests. File access goes through the storage access framework, which needs no permission.

docs — Video and AudioRecorder no longer hand out these permissions as a copy-paste block. They now explain when the permissions are actually needed, bound the legacy ones with maxSdkVersion, and the Android publishing guide warns about the Play policy.

Why it matters

Apps that never touch the media store were shipping permissions that can get a release rejected at review. The fix is subtractive — nothing gains a capability it didn't have, and anything that genuinely needs media access can still declare it explicitly via [tool.flet.android.permission].

Summary by Sourcery

Remove default broad Android media/storage permissions and align manifests, CLI presets, and docs with Google Play’s Photo and Video permissions policy.

Bug Fixes:

  • Stop bundling READ/WRITE_EXTERNAL_STORAGE with the cross-platform microphone permission group in flet-cli so apps don’t receive unintended storage access.

Enhancements:

  • Drop media and legacy external storage permissions from Android client manifests so file access relies on the storage access framework without explicit permissions.
  • Update Video and AudioRecorder docs to clarify when Android media/storage permissions are actually required and recommend system pickers and app-scoped storage.
  • Adjust example permission configurations to use CAMERA/RECORD_AUDIO and bound READ_EXTERNAL_STORAGE with maxSdkVersion in docs and example pyproject.toml.

Documentation:

  • Document Google Play’s Photo and Video Permissions policy impacts and advise declaring only necessary media/storage permissions, with concrete guidance on using FilePicker and maxSdkVersion bounds.

Google Play's Photo and Video Permissions policy rejects apps targeting
API 33+ that declare READ_MEDIA_IMAGES / READ_MEDIA_VIDEO when the system
pickers are sufficient, and it flags the legacy *_EXTERNAL_STORAGE
permissions when they are unbounded.

- flet-cli: the "microphone" cross-platform permission bundle injected
  READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE along with
  RECORD_AUDIO, so every app built with `--permissions microphone` got
  broad storage access it never asked for. Recording only needs
  RECORD_AUDIO; recordings go to app-scoped storage.
- client: drop READ_MEDIA_AUDIO, READ_MEDIA_VIDEO and both
  *_EXTERNAL_STORAGE from the Android manifests. File access goes through
  the storage access framework, which needs no permission.
- docs: Video and AudioRecorder no longer hand out these permissions as a
  copy-paste block; explain when they are actually needed, bound the
  legacy ones with maxSdkVersion, and warn about the Play policy in the
  Android publishing guide.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@FeodorFitsner
FeodorFitsner merged commit 01bf7d5 into main Jul 30, 2026
17 of 188 checks passed
@FeodorFitsner
FeodorFitsner deleted the fix/android-media-permissions branch July 30, 2026 22:51
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.

1 participant