Fix file access permission if opened for the first time via "share" #85#271
Fix file access permission if opened for the first time via "share" #85#271naveensingh merged 19 commits intoFossifyOrg:mainfrom jguegel:main
Conversation
update changelog
…ctivity.kt Co-authored-by: Naveen Singh <36371707+naveensingh@users.noreply.github.com>
Co-authored-by: Naveen Singh <36371707+naveensingh@users.noreply.github.com>
Co-authored-by: Naveen Singh <36371707+naveensingh@users.noreply.github.com>
Signed-off-by: Jan Guegel <jan@guegel.eu>
Signed-off-by: Jan Guegel <jan@guegel.eu>
There was a problem hiding this comment.
It'll be better and simpler to move handleStoragePermission() (and friends) from MainActivity to SimpleActivity and then reuse it in both places. Currently, we have duplicated code and no checks for pre-R devices.
Also, raise pull requests from a new branch every time instead of your main branch, and keep your main in sync before branching. That way, you'll avoid repushing the same commits in every pull request.
(Comments below are just bonus feedback)
Signed-off-by: Jan Guegel <jan@guegel.eu>
Signed-off-by: Jan Guegel <jan@guegel.eu>
|
yeah next PR will be from own branch then, still just playing around a bit |
naveensingh
left a comment
There was a problem hiding this comment.
I think you misunderstood my comment. Even after your changes:
- The
handleStoragePermission()method and related constants are still inMainActivity. They should be inSimpleActivity. - There's still duplicated code because
handleStoragePermission()is not being reused inSaveAsActivity. - There's still no permission request for Android 10 and below versions in
SaveAsActivity. Reusing thehandleStoragePermission()method will also solve this.
Also, are you not testing your changes?
…ty.kt introduced tryInitFileManager() to SaveAsActivity.kt removed const MANAGE_STORAGE_RC from MainActivity.kt Signed-off-by: Jan Guegel <jan@guegel.eu>
|
i am testing, just with android 16 and there it did work. |
Signed-off-by: Jan Guegel <jan@guegel.eu>
Signed-off-by: Jan Guegel <jan@guegel.eu>
|
so i think i could fix it (and the linter is happy too) |
thanks for the feedback! Co-authored-by: Naveen Singh <36371707+naveensingh@users.noreply.github.com>
Signed-off-by: Jan Guegel <jan@guegel.eu>
Co-authored-by: Naveen Singh <36371707+naveensingh@users.noreply.github.com>
Type of change(s)
What changed and why
Before & after preview
reuses the file permission view from mainactivity
Closes the following issue(s)
Checklist
CHANGELOG.md(if applicable).