Add rewind after interruptions setting - #5611
Open
mpgirro wants to merge 2 commits into
Open
Conversation
Rewinds playback by a configurable number of seconds (off, 5-60s, default 5s) when it resumes after an audio interruption such as a call, alarm or navigation prompt. When both this and intelligent playback resumption would rewind the same resume, the larger amount wins so they never stack. Ducking does not trigger a rewind, only pauses caused by audio focus loss do. Behind the interruption_rewind feature flag. Device-local setting, not synced.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds an optional "Rewind after interruptions" setting: when playback resumes after an audio interruption (phone call, alarm, Assistant, Android Auto navigation prompt or another app taking audio focus), Pocket Casts seeks back a configurable number of seconds so listeners don't lose context. This is especially useful in the car, where navigation prompts regularly interrupt playback. A matching PR with identical behavior is open for iOS: Automattic/pocket-casts-ios#4788.
Behavior
interruption_rewindfeature flag (default: debug/prototype builds only). The setting is device-local; adding it to named-settings sync would need a server-side key and is left as a possible follow-up for maintainers.Implementation notes
PlaybackManager.onFocusLossmarks its pause as interruption-caused; the marker travels throughpauseSuspendand is consumed (and cleared) inonPlayerPaused, so pauses reaching that callback via other paths (sleep timer, cast receiver, error paths) can never reuse a stale value.ResumptionHelpercomputes the existing pause-length ladder and the interruption rewind separately and appliesmaxOf()of the two.Testing Instructions
interruption_rewindis on by default there) and start playing an episode.Screenshots or Screencast
The new settings row reuses the existing
SettingRadioDialogRowcomponent below Intelligent playback resumption.Checklist
./gradlew spotlessApplyto automatically apply formatting/linting)modules/services/localization/src/main/res/values/strings.xmlSettingsGeneralInterruptionRewindChangedEvent(value property = chosen seconds); the event type comes from the generated Event Horizon library, which I can't extend as an external contributor - there is a TODO at the call site inPlaybackSettingsFragment.I have tested any UI changes...