Repository navigation
feat(startup): prep for making MANAGE_EXTERNAL_STORAGE skippable - #22759
Conversation
* Startup: allows an empty AnkiDroid directory instead of throwing * no code paths exercise this yet And a couple of test fixups to ensure they wouldn't hit our startup changes/ make preconditions clear. Part of 13574 Assisted-by: Claude Fable 5 - implementation Assisted-by: GPT-6.1-Sol xhigh - review and fixups
to `maybeSetDefaultCollectionPath` - it now may return with no change. Part of 13574 Assisted-by: GPT-6.1-Sol xhigh
…ssible For 'full' builds, leave the collection path unset until `MANAGE_EXTERNAL_STORAGE` has been granted. The path will be set on the permissions screen. No change for 'play' builds Mostly a non-user-facing change - fixes a case with intent-based launches closing (e.g. a direct Reviewer launch) Part of 13574 Assisted-by: Claude Fable 5 - implementation Assisted-by: GPT-6.1-Sol xhigh - review and fixups
criticalAY
left a comment
There was a problem hiding this comment.
Reviewed manually, looks clean!
mikehardy
left a comment
There was a problem hiding this comment.
Assisted-by: grok-4.7-medium
Thank you — deferring the public path until All files access is granted keeps the play and legacy paths unchanged and matches the policy tests.
Git: checked out the PR branch; HEAD matched the tip; rebased three commits onto ankidroid/main without conflicts (no push).
Local validation: lint (lintAll, ktlintCheck, lint-rules:test), unit (jacocoUnitTestReport), and release emulator tests (TEST_RELEASE_BUILD=true via run_emulator_tests.py on emulator-5556 / API35_GAPI; emulator green on retry after a configuration-cache pack error).
Reviewed the startup storage deferral: on full builds UserChoosesOnPermissionScreen leaves PREF_COLLECTION_PATH unset until MANAGE_EXTERNAL_STORAGE is granted, so storageDecision stays undecided and IntentHandler no longer treats an unreadable public folder as decided; play builds stay on app-private storage and Android 10 and below stay on the legacy public path. DeckPicker / permissions flow still persist public storage only after the grant, with coverage in StoragePolicyTest and SetupStorageTest.
some acceptable findings, no action required, just leaving for posterity: UserChoosesOnPermissionScreen KDoc mentions app-private skip work not in this PR; PR body “non-functional” vs user-visible intent launch behavior; commit subjects sit just under the 50-character checklist line.
Note
Assisted-by: Claude Fable 5 - implementation
Assisted-by: GPT-6.1-Sol xhigh - review and fixups
Purpose / Description
Split out from a larger PR to land #13574
Fixes
full(F-Droid/GitHub) releases users to grant theAll files accesspermission #13574Approach
This is effectively a non-functional change:
The collection path will now be unset until the permissions screen if the directory is inaccessible (a public folder using a
fullbuild), it now gets set whenMANAGE_EXTERNAL_STORAGEis granted.How Has This Been Tested?
This area of the code is already HEAVILY tested
Checklist