Skip to content

fix(storage): handle SAF providers without persistable grants - #3252

Merged
fire-light42 merged 1 commit into
recloudstream:masterfrom
SamoTech:fix/saf-provider-persistable-permission
Oct 15, 2026
Merged

fire-light42 merged 1 commit into
recloudstream:masterfrom
SamoTech:fix/saf-provider-persistable-permission

Conversation

@SamoTech

Copy link
Copy Markdown
Contributor

Fixes #3114.

Problem

Selecting a folder through certain non-system Storage Access Framework (SAF) providers can crash CloudStream with a SecurityException when takePersistableUriPermission() is called without a persistable permission grant.

Changes

  • Catch SecurityException when attempting to acquire persistable URI permissions.
  • Log the exception and continue processing the selected folder URI.
  • Preserve the existing folder-selection callback and path handling.

Limitations

This change prevents the reported crash but does not guarantee persistent access when a provider grants only temporary permissions. The selected folder may become inaccessible after those permissions expire.

Validation

  • Verified the change against the reported logcat exception and its call site.
  • Local Gradle build and automated tests have not been run.

AI assistance was used during development.

@fire-light42 fire-light42 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the crash fix!

@fire-light42
fire-light42 merged commit d9c55e2 into recloudstream:master Oct 15, 2026
2 checks passed
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.

App Crashed - Fix Support for non-system SAF providers

2 participants