Skip to content

Add option to disable seek slider on lock screen#5261

Open
OwaisKhatri wants to merge 3 commits into
Automattic:mainfrom
OwaisKhatri:add/enable-scrubbing-in-notification
Open

Add option to disable seek slider on lock screen#5261
OwaisKhatri wants to merge 3 commits into
Automattic:mainfrom
OwaisKhatri:add/enable-scrubbing-in-notification

Conversation

@OwaisKhatri
Copy link
Copy Markdown
Contributor

@OwaisKhatri OwaisKhatri commented Apr 29, 2026

Description

This PR is raised to resolve the issue while accidentally seeking to a new position in the podcast.

Fixes # 1002

Testing Instructions

  1. Go to Settings Screen.
  2. In settings, go to general section.
  3. In general, go to Player section.
  4. Enable the option (Enable lock screen scrubbing).
  5. Play any episode. Seek slider will not change its position.

Screenshots or Screencast

Screenshot_20260429-184641

Checklist

  • If this is a user-facing change, I have added an entry in CHANGELOG.md
  • Ensure the linter passes (./gradlew spotlessApply to automatically apply formatting/linting)
  • I have considered whether it makes sense to add tests for my changes
  • All strings that need to be localized are in modules/services/localization/src/main/res/values/strings.xml
  • Any jetpack compose components I added or changed are covered by compose previews
  • I have updated (or requested that someone edit) the spreadsheet to reflect any new or changed analytics.

@OwaisKhatri OwaisKhatri requested a review from a team as a code owner April 29, 2026 13:47
@OwaisKhatri OwaisKhatri requested review from MiSikora and removed request for a team April 29, 2026 13:47
@OwaisKhatri
Copy link
Copy Markdown
Contributor Author

@MiSikora Create a new PR for the issue 1002, due to contributor conflicts from my end.

Copy link
Copy Markdown
Contributor

@MiSikora MiSikora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants