Add configurable download location via Storage Access Framework#8844
Open
sahilpatel2521 wants to merge 2 commits into
Open
Add configurable download location via Storage Access Framework#8844sahilpatel2521 wants to merge 2 commits into
sahilpatel2521 wants to merge 2 commits into
Conversation
35c9795 to
ca74470
Compare
ca74470 to
b9859db
Compare
b9859db to
67a0a9b
Compare
67a0a9b to
01535d7
Compare
01535d7 to
98ed8c7
Compare
- Let users pick a custom download folder from Settings while preserving default Downloads behavior for existing users - Declare DownloadLocationSettingsActivity in AndroidManifest.xml - Reuse downloadsLocationSettingTitle for activity label - Replace nonexistent OneLineSwitchItem with OneLineListItem using showSwitch in layout - Pass correct buildTreeDocumentUri to folder picker initial URI - Add fallback download location snackbar messaging - Closes duckduckgo#8832
98ed8c7 to
fc3c4e8
Compare
This was referenced Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task/Issue URL: #8832
Description
Add configurable download location via Storage Access Framework.
Steps to test this PR
Download Settings Navigation
DownloadLocationSettingsActivitylaunches successfully without throwing anActivityNotFoundException.Custom Folder Selection (Storage Access Framework)
Downloadfolder.Sahil) and authorize access.Downloading Files
Downloadfolder.Fallback Verification (Folder Revoked/Unavailable)
Downloadfolder.Automated Tests
UI Changes
Note
Medium Risk
Changes the core browser download write path and persisted storage permissions; fallback behavior limits data loss risk but regressions could affect where files land or whether open/share works.
Overview
Adds configurable download folders via Storage Access Framework: a new Downloads entry under Other Settings opens
DownloadLocationSettingsActivity, where users can pick a custom tree URI (persisted in DataStore) or keep the default public Downloads directory.The download stack is refactored around
DownloadDestinationandDownloadDestinationResolver:AndroidFileDownloaderresolves the destination before enqueueing work, serializes it throughFileDownloadWorker, andDownloadFileWriterwrites either to disk or SAFcontent://URIs. If the chosen folder is no longer accessible, downloads fall back to default and UI surfacesShowDownloadLocationFallbackMessagesnackbars (browser, Duck Chat, subscriptions).DownloadFileAccessorand path-basedopenFileAtPath/shareFileAtPathreplace directFileusage in the downloads list and notifications so finished items work for both filesystem paths and content URIs. A MaestroreleaseTestflow covers navigating to download location settings.Reviewed by Cursor Bugbot for commit d66b10a. Bugbot is set up for automated code reviews on this repo. Configure here.