fix(tv): release the screen while playback is paused - #189
Merged
RXWatcher merged 1 commit intoAug 6, 2026
Merged
Conversation
A paused player held the display awake indefinitely: the screensaver never fired, leaving a static frame parked on the panel for as long as the viewer was away — precisely what burn-in protection exists to prevent, and reported against a Shield driving an OLED. Two holders, both unconditional: - TvPlayerScreen added FLAG_KEEP_SCREEN_ON in a DisposableEffect keyed only on context — set at mount, cleared at dispose, blind to playback state. Now gated on !isPaused && (isPlaying || isBuffering), the same rule the phone player adopted for its own version of this report (Pixel 8 Pro / S25 Ultra). Buffering counts as playing so a rebuffer cannot blank the screen mid-watch. - tv_player_view.xml hardcoded android:keepScreenOn="true" on the PlayerView. A view-level keepScreenOn propagates to the same window flag and never lets go, so the gate alone changed nothing. Removed; the gated effect is the flag's single owner. Verified on a Google TV Streamer via dumpsys window across play → pause → resume → pause: the flag is present exactly while isPlaying and gone within a beat of each pause. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N7bPXi6NaUecM18rfWKAmP
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe TV player now keeps the display awake only while playback is active or buffering. It clears the flag when playback is paused, inactive, or disposed. The layout no longer sets the flag for the screen lifetime. ChangesTV screen-awake behavior
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Problem
A paused player held the display awake indefinitely — the system screensaver never fired, leaving a static frame parked on the panel for as long as the viewer was away. Reported against a Shield; on an OLED this is exactly what burn-in protection exists to prevent.
Root cause — two unconditional holders
TvPlayerScreenaddedFLAG_KEEP_SCREEN_ONin aDisposableEffect(context)— set at mount, cleared at dispose, blind to playback state.tv_player_view.xmlhardcodedandroid:keepScreenOn="true"on thePlayerView. A view-levelkeepScreenOnpropagates to the same window flag and never releases — which is why gating the effect alone changed nothing when verified on device.Fix
The window flag is now gated on
!isPaused && (isPlaying || isBuffering)— the same rule the phone player already adopted for its own version of this report (Pixel 8 Pro / S25 Ultra), so both form factors now behave identically: pause long enough and the screensaver takes over; resume and the screen is held again. Buffering counts as playing so a rebuffer at a scene boundary cannot blank the screen mid-watch.The XML attribute is removed; the gated effect is the flag's single owner.
Verification
On a Google TV Streamer, reading the window flags from
dumpsys windowat each transition:androidTvAppunit suite green.Scope
TV only — the phone already has this gate. The TV audiobook player never held the flag, so audio-only playback is unaffected (the screensaver firing over a paused audiobook cover is already the intended behaviour).
Summary by CodeRabbit