feat: Make all file access permission optional on full builds - #21046
feat: Make all file access permission optional on full builds#21046Fandroid745 wants to merge 1 commit into
Conversation
BrayanDSO
left a comment
There was a problem hiding this comment.
Instead of a skip button, simply don't disable the Continue button if the permission hasn't been allowed. If they tap the button, the dialog should be shown
| <string name="btn_skip_permission">Skip</string> | ||
| <string name="private_storage_warning_title"> Limited Storage access</string> | ||
| <string name="private_storage_warning">Without this permission, Your Ankidroid collection will be stored in app\'s private storage and will be permanently deleted if you uninstall Ankidroid.</string> |
There was a problem hiding this comment.
this file isn't translated, so those strings shouldn't be here
|
The title shouldn't include "needs"
|
david-allison
left a comment
There was a problem hiding this comment.
This is one of our really badly wanted fixes, thank you!!!!!!!!!!!!!
Initially this looks good to me. This will want a lower priority follow up issue to fix the AnkiDroid directory preference. Please don't fix it in this PR, as that dialog is being rewritten
- change the button text to "skip", don't add another button
- Fix the title, see my other comment
- Use "app private", not "private"
| <string name="use_private_storage_key">usePrivatestorage</string> | ||
| <string name="btn_skip_permission">Skip</string> | ||
| <string name="private_storage_warning_title"> Limited Storage access</string> | ||
| <string name="private_storage_warning">Without this permission, Your Ankidroid collection will be stored in app\'s private storage and will be permanently deleted if you uninstall Ankidroid.</string> |
There was a problem hiding this comment.
AnkiDroid
I don't like this warning, the UI should be a selection, rather than showing a user a scary dialog during the onboarding process
I'd block this if it weren't F-Droid only - users there are more understanding of privacy
Add an issue and a TODO to rethink the UI
There was a problem hiding this comment.
AnkiDroidI don't like this warning, the UI should be a selection, rather than showing a user a scary dialog during the onboarding process
I'd block this if it weren't F-Droid only - users there are more understanding of privacy
Add an issue and a TODO to rethink the UI
Will do!
I had created that dialog as it was one of the comments on the issue
|
|
||
| val externalFilesDir = | ||
| requireContext().getExternalFilesDir(null) ?: requireContext().filesDir | ||
| val privateDir = File(externalFilesDir, "AnkiDroid").apply { mkdirs() } |
There was a problem hiding this comment.
Nit: mkdirs() return value isn't checked. If it fails (disk full/corrupted), the pref gets set to a non existent path.
42bcc35 to
83f9a8b
Compare
|
Important Maintainers: This PR contains Strings changes
|
51b427b to
b73806c
Compare
|
I have addressed the review comments now, |
david-allison
left a comment
There was a problem hiding this comment.
Please add tests, this is a vital path to get correct
|
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
|
@david-allison could you reopen this |
|
Done |
b73806c to
be365c4
Compare
|
Snapshot diff report vs
All 2 changed screenshotsAllActivitiesScreenshotTest
|
|
Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
c9cc684 to
36ff6ee
Compare
1e44f97 to
1f295f1
Compare
1f295f1 to
176087a
Compare
1aa77b8 to
37210be
Compare
9b6aadb to
97026bb
Compare
97026bb to
d3727bd
Compare
|
@david-allison could you review this, I have handled the case where the user has given full storage access but revokes permission now |
|
Bug: on a new install, "Skip" loops back to the permission screen (until they grant the permission) Could you add a regression test for this? This PR should be using the Sorry for the back & forth here, Feel free to delegate a few PRs to me here to get this over the line sooner. This is our most requested feature and I've now got capacity to see it through: |
|
Thanks for the help! I have limited time currently, could you get this over the line. |
david-allison
left a comment
There was a problem hiding this comment.
Removing this from my review queue. Blocked on
Note
Assisted-by: Gemini 3.1 Pro - Research and Tests
Purpose / Description
AnkiDroid forces the users to grant the "All files access" permission on full builds(fdroid/github) with no way to opt out. The users who sync via AnkiWeb or manage their have no need to grant this permission.
Fixes
full(F-Droid/GitHub) releases users to grant theAll files accesspermission #13574Approach
/storage/emulated/0/Android/data/com.ichi2.anki.debug/files/AnkiDroid and deleted on uninstall.
How Has This Been Tested?
Tested on Android 15 device (with the build variants fullDebug and fullRelease)
Screenshots
Skip button to skip all files permission
Dialog explaning the trade-offs

The app private storage being used

Checklist