Skip to content
This repository was archived by the owner on Oct 8, 2026. It is now read-only.

Prevent screen turning off during playback & Android 16 SDK - #422

Merged
oxyroid merged 2 commits into
oxyroid:masterfrom
PiloUnk:master
Sep 8, 2026
Merged

oxyroid merged 2 commits into
oxyroid:masterfrom
PiloUnk:master

Conversation

@PiloUnk

@PiloUnk PiloUnk commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Two independent smartphone-app fixes, pushed as separate commits on master:

  • a0314fb3 — Keep the screen on during channel playback by setting
    WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON directly on
    PlayerActivity's window, instead of relying solely on
    PlayerView.setKeepScreenOn(true). The View-level propagation to the
    window flag is unreliable on some OEM builds (observed on Samsung One UI
    on a Galaxy S23), causing the screen to time out and turn off mid-playback
    even though keepScreenOn was always true in this Activity.
  • d63a0299 — Bump app/smartphone's targetSdk from 33 to 36 (Android 16).
    It was left far behind compileSdk (37), which triggers Android's
    install-time "this app may not work well" compatibility warning on recent
    OS versions. samples/ and testing/extension-reference already target 36.

AI Agent Checklist

Before submitting this PR, confirm:

  • I identified the task type.
  • I read the root AGENTS.md.
  • I read all relevant directory-level AGENTS.md files.
  • I avoided unrelated refactors.
  • I respected module dependency boundaries.
  • I did not move low-level data access into UI.
  • I did not introduce unnecessary dependencies.
  • I ran the smallest relevant validation command.
  • I documented any validation that could not be run.
  • I listed risks or compatibility concerns.

Instructions Read

List the instruction files read for this change:

  • AGENTS.md
  • app/AGENTS.md
  • docs/ai/playbooks/playback-pipeline.md
  • docs/ai/playbooks/apk-size.md
  • docs/ai/VALIDATION_MATRIX.md

Validation

Commands run:

./gradlew :app:smartphone:assembleDebug
./gradlew :app:smartphone:assembleRelease

Results:

BUILD SUCCESSFUL — both variants compiled and packaged cleanly with
targetSdk 36 and the window-level keep-screen-on flag.
Release APK: 10.7 MB (R8 minify + resource shrink enabled, as before).

Commands not run:

./gradlew :app:tv:compileDebugKotlin
Manual on-device screen-timeout check on affected OEM (Samsung One UI)

Reason:

- app/tv: neither commit touches any app/tv source or build file; the
  Android TV variant's targetSdk (33) and playback code are unaffected.
- Manual OEM check: verifying the original screen-timeout bug and its fix
  requires a physical device with a real user-configured screen-timeout
  setting, which isn't reproducible in this (headless) environment. The
  fix was validated by code path (window flag set in onCreate, matches
  standard practice for a playback-dedicated Activity) but not re-tested
  live on the reporting device.

Risk Notes

Mention any risk areas:

Playback behavior: PlayerActivity's window now carries
FLAG_KEEP_SCREEN_ON for its whole lifecycle (cleared automatically on
destroy); the existing PlayerView.setKeepScreenOn call is left in place
as a no-op-redundant safeguard, not removed.
API compatibility: targetSdk 36 opts the app into Android
14/15/16 behavior changes gated by targetSdk (e.g. predictive back,
enforced edge-to-edge). Edge-to-edge is already explicitly handled via
enableEdgeToEdge(); other targetSdk-gated behaviors were not
exhaustively audited beyond a successful compile/assemble of both build
types.
Binary size: no dependencies added; release artifact size unchanged
in kind (still minified/shrunk as before).
TV focus behavior / Resource-i18n / Database migration: not applicable,
no app/tv, i18n, or Room changes in either commit.

PiloUnk and others added 2 commits September 6, 2026 18:52
…w propagation

PlayerView.setKeepScreenOn(true) depends on the view staying attached and
visible to propagate FLAG_KEEP_SCREEN_ON to the window, which is unreliable
on some OEMs (e.g. Samsung One UI), causing the screen to turn off during
playback. Since PlayerActivity is dedicated to playback, set the window
flag directly in onCreate.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
targetSdk was still 33 (Android 13) while compileSdk is 37, which
triggers Android's install-time compatibility warning on newer OS
versions. Align with the samples/testing modules, which already
target 36.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@oxyroid
oxyroid merged commit 3d9f0bb into oxyroid:master Sep 8, 2026
1 check passed
oxyroid added a commit that referenced this pull request Sep 8, 2026
@oxyroid

oxyroid commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Reverted. Resume old prevent state before leaving playback. And do not change targetSdkVersion.

@PiloUnk

PiloUnk commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Indeed, didn't see the various states. Sorry for that!

Would this be better?
PiloUnk@bbb8456

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants