Skip to content

fix(sdcard): stop crash when deleting a file without storage permission - #3139

Merged
bajrangCoder merged 1 commit into
mainfrom
fix/sdcard-delete-permission-crash
Dec 1, 2026
Merged

bajrangCoder merged 1 commit into
mainfrom
fix/sdcard-delete-permission-crash

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member
  • Fixes app crash (SecurityException: Permission Denial ... requires that you obtain access using ACTION_OPEN_DOCUMENT in SDcard.delete) when deleting a file the app no longer has storage access to.

DocumentsContract.deleteDocument throws SecurityException when the app
no longer holds a grant for the document. delete only caught
FileNotFoundException, so the exception escaped the worker thread and
killed the app. Report it through the error callback instead.
@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The change appears safe to merge.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The change appears safe to merge.

Summary

SDcard.delete now catches RuntimeException, including SecurityException, and sends the error through callback.error instead of letting it escape the worker thread.

  • SD card deletes report runtime errors through the error callback.

Reviews (1) · Last reviewed commit: "fix(sdcard): stop crash when deleting wi..." · Reviewed by Greptile

@bajrangCoder
bajrangCoder added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit 7b42ff2 Dec 1, 2026
19 of 20 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Dec 1, 2026
@bajrangCoder
bajrangCoder deleted the fix/sdcard-delete-permission-crash branch December 1, 2026 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant