Skip to content

fix(app): keep caches and connections when leaving the app - #2317

Merged
A-EDev merged 11 commits into
mainfrom
fix/app-trim-on-exit
Nov 23, 2026
Merged

A-EDev merged 11 commits into
mainfrom
fix/app-trim-on-exit

Conversation

@A-EDev

@A-EDev A-EDev commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The app-level memory trim now runs only at TRIM_MEMORY_BACKGROUND and above. Android 14+ sends TRIM_MEMORY_UI_HIDDEN on every app exit, and the old >= RUNNING_LOW check emptied Coil's memory cache, the playlist caches and every idle OkHttp connection each time.
  • Coil's memory cache is left to Coil: 3.5.0's AndroidSystemCallbacks already halves it at RUNNING_LOW and clears it at BACKGROUND.
  • AppMemoryTrim holds the level rule, with unit tests.

Related issue

None.

Change type

  • Bug fix
  • Feature
  • Refactor or maintenance
  • Build, packaging, or CI
  • Documentation

Validation

Run on the top of the stack (fix/pip-seamless-resize), which contains this change:

  • ./gradlew :app:assembleGithubDebug: passed
  • ./gradlew :app:testGithubDebugUnitTest: 7,046 tests, 0 failures, 46 skipped
  • I ran any additional flavor-specific build or test tasks affected by this change: spotlessCheck, :app:compileGithubDebugKotlin, :app:compileFossDebugKotlin all passed
  • I manually tested the affected behavior on an Android device or emulator.

Test device and Android version: Not run on a device (pure policy change, covered by unit tests)

Screenshots or recordings

Risk and compatibility

  • Memory: caches now survive leaving the app. Under real pressure Coil still trims itself, and onLowMemory and BACKGROUND still release the playlist caches and idle connections.

  • Network: background audio keeps its connection to googlevideo between segments instead of reconnecting after each app exit.

  • The change does not introduce secrets, private data, or unexpected telemetry.

  • New user-facing text uses Android string resources.

  • Dependency and lockfile changes are intentional and limited to this PR.

  • Room schema changes include the required version bump and migration, or this PR does not change the Room schema.

  • Breaking changes and upgrade steps are clearly documented.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Nov 23, 2026
fix(pip): resize the video window seamlessly
fix(shorts): enter picture-in-picture with the system animation
feat(pip): Replay and Retry buttons, kept left to right in every language
perf(ambient): pause frame capture in picture-in-picture
perf(player): let ExoPlayer own the wake and Wi-Fi locks
@github-actions github-actions Bot added player Video and audio playback ui Compose UI, theming, or Material 3 surfaces labels Nov 23, 2026
@A-EDev
A-EDev merged commit 68eaae2 into main Nov 23, 2026
9 checks passed
@A-EDev
A-EDev deleted the fix/app-trim-on-exit branch November 23, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation player Video and audio playback ui Compose UI, theming, or Material 3 surfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant