-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix permission handling in Multimedia editor #5841
Fix permission handling in Multimedia editor #5841
Conversation
I worry this is too complex, I hope splitting this into commits makes it easier to review. |
I'll get on with the auto fixes tomorrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the separate commits made it pretty easy to review. I don't mind larger PRs especially if they show the transform in bite-size chunks like that - I keep the big diff open on one tab to make sure a comment I'd write isn't addressed somewhere later, and then flip through each commit - no problem.
Lots of little things I think but nothing serious that seemed off, and if it works, it works - I'll pull it and test it after this round
Good work digging through the advanced editor it's not easy to reason about
AnkiDroid/src/main/java/com/ichi2/anki/multimediacard/utils/Permissions.java
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/multimediacard/activity/MultimediaEditFieldActivity.java
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/multimediacard/activity/MultimediaEditFieldActivity.java
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/multimediacard/activity/MultimediaEditFieldActivity.java
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/multimediacard/activity/MultimediaEditFieldActivity.java
Outdated
Show resolved
Hide resolved
AnkiDroid/src/main/java/com/ichi2/anki/multimediacard/activity/MultimediaEditFieldActivity.java
Show resolved
Hide resolved
We can get to the AudioView screen from the pronunciation screen, this is a one-way transition, and should succeed, even if we can't use the screen to record audio.
Previously, we would get into a loop of asking for permissions if the user ticked "deny & remember". Now we close the dialog and cancel the activity. We now only try and redraw if we were successful. Fixes ankidroid#5407
If we went through the permission check once, we don't need to go through it again
Previously, onLostFocus would kill the previous activity. If we fail navigation due to permissions, then we had nowhere to go Now, we only perform this if we have permission and can create a field controller
Co-Authored-By: Mike Hardy <[email protected]>
Co-Authored-By: Mike Hardy <[email protected]>
4f74876
to
dc6615b
Compare
Review fixes done. |
Here is an overview of what got changed by this pull request: Issues
======
- Added 1
Complexity increasing per file
==============================
- AnkiDroid/src/main/java/com/ichi2/utils/Permissions.java 1
See the complete overview on Codacy |
Same as the other - this one looks great just waiting on CI to go through owing to macOS intermittency 💪 |
2.10alpha54 released just now has this whenever google delivers it to you |
released in 2.9.6beta4 |
Purpose / Description
Editing a note, selecting "Record Audio", with denied & remembered permissions would soft crash the app.
Fixes
Fixes #5407
Approach
Explained in #5407
How Has This Been Tested?
Toasts are displayed on permissions issues.
Checklist
if
statements)