Skip to content

fix(android): drop READ_MEDIA_* for the system photo picker (Play photo/video policy); release 2.2.3 (Android only) - #257

Merged
morepriyam merged 2 commits into
mainfrom
fix/android-photo-permissions
Oct 8, 2026
Merged

morepriyam merged 2 commits into
mainfrom
fix/android-photo-permissions

Conversation

@morepriyam

@morepriyam morepriyam commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Google Play's pre-review checks blocked the 2.2.2 production release: "Use alternative system pickers for photos / videos". Apps that aren't gallery apps may not request READ_MEDIA_IMAGES / READ_MEDIA_VIDEO on Android 13+ and must use the system photo picker.

Pulse doesn't need either permission:

  • Import opens videos with expo-image-picker's launchImageLibraryAsync, which on Android launches the system photo picker (PickVisualMedia in ImageLibraryContract.kt) and needs no permission. The expo-media-library permission request before it was redundant.
  • Save to Photos asks write-only. In expo-media-library's Android code, saving needs no permission on Android 13+ (hasWritePermissions() returns false there); on Android 12 and lower it uses WRITE_EXTERNAL_STORAGE, which stays.

The same permissions were in 2.0.4 (the commit it shipped from, e550fdd, has the identical expo-media-library config); the check is new, not the permissions.

Changes

  • app.json: expo-media-library granularPermissions → [] (the plugin's default adds photo, video and audio), and READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO, READ_MEDIA_VISUAL_USER_SELECTED added to android.blockedPermissions. Blocking matters: expo-media-library's own library manifest declares READ_MEDIA_VISUAL_USER_SELECTED.
  • src/features/recorder/use-recorder.ts: the import's photo-library permission check and request are iOS-only (get: Platform.OS === 'ios' on the hook, and the gate in importClip). Required, not cleanup: with the permissions out of the manifest, expo-media-library throws on Android 13+ when asked about photo/video access (assertGranularPermissionIntegrity).
  • iOS is unchanged.

Tested

  • npx tsc --noEmit with main's dependencies (npm ci): clean.
  • npx expo prebuild --platform android: the generated AndroidManifest.xml marks all four READ_MEDIA_* permissions tools:node="remove".
  • ./gradlew :app:processReleaseMainManifest: the merged release manifest has no READ_MEDIA_* permission at all (including the READ_MEDIA_VISUAL_USER_SELECTED that expo-media-library's library manifest declares). Storage permissions left: READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE, both maxSdkVersion="32".

Not tested yet

  • On a phone: import and Save to Photos on Android 14+ (S24) and on an Android 12-or-lower emulator.
  • A full release build / Play's own check (the merged manifest above is what goes into the bundle).

Release 2.2.3 (Android only)

This PR also cuts 2.2.3: app.json version 2.2.3, Android base versionCode 20220 → 20230 (CI adds the run number; the last Play upload was 20236), package.json / lock 2.2.3.

Android only: iOS behaviour is unchanged by this fix, and iOS 2.2.2 is in App Review, so iOS stays on 2.2.2 until the next regular release (#255 runbook: a one-platform bug ships on that platform only).

Release note: "Importing videos on Android no longer asks for access to your photos."

After merge

Run only the Android build workflow with track=production. On Play Console, the blocked 2.2.2 production change is replaced by 2.2.3. Shipping without the on-phone test listed above, by decision; check import and Save to Photos on the S24 once 2.2.3 is live.

…_* (Play photo/video policy)

Play's pre-review checks flag READ_MEDIA_IMAGES / READ_MEDIA_VIDEO: apps that aren't gallery
apps must use the system photo picker instead. Pulse already does: expo-image-picker opens
Android's PickVisualMedia picker, which needs no permission, and saving to Photos is
write-only, which needs no permission on Android 13+.

- app.json: expo-media-library granularPermissions [] (the default adds all three), and
  READ_MEDIA_IMAGES/VIDEO/AUDIO/VISUAL_USER_SELECTED in blockedPermissions so they're removed
  from the merged manifest even when a library manifest declares them
  (expo-media-library declares READ_MEDIA_VISUAL_USER_SELECTED).
- use-recorder: the import's photo-library permission check and request are iOS-only. On
  Android 13+ expo-media-library throws when asked for a photo/video permission the manifest
  doesn't declare, so the hook doesn't check there either.
Copilot AI balanced review requested due to automatic review settings October 8, 2026 19:58

Copilot AI 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.

🔵 Needs a closer look

Release-manifest and physical-device validation remain pending for this policy-sensitive permission change.

0 open findings

What changed in this PR

Updates Android imports to use the permissionless system photo picker, complying with Google Play media-access policy while preserving iOS behavior.

Changes:

  • Blocks Android READ_MEDIA_* permissions.
  • Limits import permission checks to iOS.
File Description
app.json Removes granular media permissions and blocks manifest additions.
src/​features/​recorder/​use-recorder.ts Skips media-library permission checks on Android.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI balanced review requested due to automatic review settings October 8, 2026 20:05
@morepriyam morepriyam changed the title fix(android): import through the system photo picker, drop READ_MEDIA_* (Play photo/video policy) fix(android): drop READ_MEDIA_* for the system photo picker (Play photo/video policy); release 2.2.3 (Android only) Oct 8, 2026

Copilot AI 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.

🟢 Approval recommended

The focused permission changes are internally consistent and preserve the required iOS and legacy Android behavior.

0 open findings

🧠 Review effort: Balanced

@morepriyam
morepriyam merged commit c5aecbe into main Oct 8, 2026
8 checks passed
@morepriyam
morepriyam deleted the fix/android-photo-permissions branch October 8, 2026 20:08
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