Add option to disable seek slider on lock screen#5261
Conversation
# Conflicts: # CHANGELOG.md
MiSikora
left a comment
There was a problem hiding this comment.
@OwaisKhatri There is an issue in the current implementation that I've highlighted in a comment. I'll be unavailable until Monday, so if you fix it before then, I won't be able to review it immediately.
| updateMedia3CustomLayout() | ||
| media3Service?.triggerNotificationUpdate() | ||
| } | ||
| Util.isAndroidAutoConnectedFlow(context).collect { autoConnected -> |
There was a problem hiding this comment.
Calling collect() here leak memory. Collecting is never cancelled unless the scope is cancelled. This means that if I play 3 episodes I will have 3 active subscriptions to isAndroidAutoConnectedFlow().
There was a problem hiding this comment.
Will it be ok to use Util.isAndroidAutoConnectedFlow(context).first()?
The terminal operator that returns the first element emitted by the flow and then cancels flow's collection. Throws NoSuchElementException if the flow was empty.
Will need to handle the exception, if the flow is empty and we can wrap it in try/catch. Does this makes sense?
Description
This PR is raised to resolve the issue while accidentally seeking to a new position in the podcast.
Fixes # 1002
Testing Instructions
Screenshots or Screencast
Checklist
./gradlew spotlessApplyto automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xml