Skip to content

Stop background timers, shake sensor, and idle Cast discovery when paused - #439

Open
TerribleTurtle wants to merge 3 commits into
pounat:mainfrom
TerribleTurtle:fix/background-pause-lifecycle
Open

TerribleTurtle wants to merge 3 commits into
pounat:mainfrom
TerribleTurtle:fix/background-pause-lifecycle

Conversation

@TerribleTurtle

@TerribleTurtle TerribleTurtle commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • stop the sleep timer shake sensor and widget stats timer when playback pauses in the background
  • stop the 30s local server probe when a book finishes on its own in the background
  • pause idle Chromecast route discovery when backgrounded without an active or reconnecting session

Why

Following up on 35005349: if you leave the app while listening and then pause from headphones or the lock screen, or let a book finish, these kept running overnight. The background check only looked at whether playback was already paused at the moment you left the app. Confirmed the shake sensor and Cast discovery shut off in dumpsys on my Pixel.

Before / after trace
Before: background while playing -> pause from headset -> shake sensor, stats timer, probe, Cast discovery stay on
After:  pause or book end while backgrounded -> all four stop; they come back on resume or when the app reopens

@TerribleTurtle
TerribleTurtle marked this pull request as ready for review October 19, 2026 19:02
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.

1 participant