-
Notifications
You must be signed in to change notification settings - Fork 1.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
[Voice to Content] Clear recorder resources #20983
Conversation
…released outside of a stop recording action
…x or the stop button is tapped
Generated by 🚫 Danger |
📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
|
📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #20983 +/- ##
==========================================
- Coverage 40.75% 40.75% -0.01%
==========================================
Files 1528 1528
Lines 70165 70174 +9
Branches 11607 11607
==========================================
+ Hits 28595 28596 +1
- Misses 38980 38988 +8
Partials 2590 2590 ☔ View full report in Codecov by Sentry. |
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 tested whether AudioRecorder.clearResources()
is called every time the bottom sheet is closed. It is not called when dismissing the bottom sheet:
- I opened the "Post from audio" bottom sheet. I tapped outside the prompt to dismiss it, and AudioRecorder.clearResources() was not invoked.
It should have been invoked in this case as well, right?
WordPress/src/main/java/org/wordpress/android/ui/voicetocontent/VoiceToContentDialogFragment.kt
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Good catch. Nope, I didn't think of this scenario. I added the logic in 9aa4aec. I don't want an accidental outside touch to stop the process when in recording or processing mode, so I am setting the isCancelableOutsideTouch dynamically.
I haven't prioritized cleaning up the code yet. My final PR will do that and clean up log lines, etc. I want to get the flow working properly first. Thanks. :) |
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.
Thanks for the update!
I have one more question. Currently, we're calling recordingUseCase.endRecordingSession() when the bottom sheet is closed, even if the MediaRecorder has not started. Shouldn't .endRecordingSession() be called only if the recording has actually started?
If you plan to handle this in the following PRs, I can approve this one.
@irfano Handled this in a future branch ... had to wait to actually have the isRecording or isPaused values available in the VM first. |
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.
LGTM! 👍🏻
This PR addresses an issue with the AudioRecorder not clearing it's resources. With this implementation the process now captures the bottom sheet close event, the close tap and sends the endRecordingSession event to the usecase. This is turn will release the resources of the recorder.
Note
The following have not yet been implemented
recording timer
orientation changes
Overall polishing of the UI
Launching Edit Post
To Test:
There is not much to test
Regression Notes
Potential unintended areas of impact
The resources are not released
What I did to test those areas of impact (or what existing automated tests I relied on)
Manual testing
What automated tests I added (or what prevented me from doing so)
N/A
PR Submission Checklist:
RELEASE-NOTES.txt
if necessary.Testing Checklist (strike-out the not-applying and unnecessary ones): N/A