docs(napplet): the 30 s background pause is an upper bound on Android 14+

The cached-app freezer suspends `:napplet` and its renderers about 10 s
after the app leaves the screen (12 s measured on an API 36 emulator), so
media and scripts stop well before BACKGROUND_PAUSE_MS. Say so where the
constant is defined, instead of promising 30 s of playback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Vitor Pamplona
2026-09-30 19:11:33 -04:00
co-authored by Claude Opus 5.5
parent 38526fe810
commit ccf1c1c75f
@@ -32,6 +32,12 @@ object NappletHostContract {
* disconnect 30 s after the UI stops (RelayProxyClientConnector's `WhileSubscribed(30000)`), so a quick * disconnect 30 s after the UI stops (RelayProxyClientConnector's `WhileSubscribed(30000)`), so a quick
* trip to another app (a 2FA code, a password manager) doesn't interrupt a page, while one left behind * trip to another app (a 2FA code, a password manager) doesn't interrupt a page, while one left behind
* stops running. Requests that act for the user are held from the first moment regardless. * stops running. Requests that act for the user are held from the first moment regardless.
*
* An upper bound, not a promise: on Android 14+ the cached-app freezer suspends `:napplet` (and its
* renderers) about 10 s after the app leaves the screen, since nothing keeps that process in the
* foreground. Measured on an API 36 emulator: frozen 12 s after Home, media stopped with it. So on those
* devices a page stops within seconds, and this pause lands (on the next unfreeze) on a page that
* already stopped.
*/ */
const val BACKGROUND_PAUSE_MS = 30_000L const val BACKGROUND_PAUSE_MS = 30_000L