From 652465910dcdcc761aa2e078ff1a82625e2a0aa5 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sun, 4 Oct 2026 22:46:00 +0200 Subject: feat(android): music keeps playing with the screen off While a track plays, the page asks the shell to stay awake (playback:keep-alive): on Android the cast's foreground service and visible WebView, with a notification; on desktop a power save blocker. Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_android_cast.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'packages/meshbay-hub/tests') diff --git a/packages/meshbay-hub/tests/test_android_cast.py b/packages/meshbay-hub/tests/test_android_cast.py index a346d15..bc5264e 100644 --- a/packages/meshbay-hub/tests/test_android_cast.py +++ b/packages/meshbay-hub/tests/test_android_cast.py @@ -111,11 +111,13 @@ def test_relay_calls_keep_their_order(): SRC / "bridge" / "Channels.kt") -def test_screen_off_survival_is_switched_on_only_while_casting(): +def test_screen_off_survival_is_switched_on_only_while_casting_or_playing(): activity = _read(SRC / "MainActivity.kt") - casting = activity.split("private fun casting(on: Boolean)", 1)[1].split("\n }", 1)[0] - assert "web.keepVisible = on" in casting - assert "startForegroundService(service) else stopService(service)" in casting + keep = activity.split("private fun keepAlive()", 1)[1].split("\n }\n", 1)[0] + assert "val on = casting || playing" in keep + assert "web.keepVisible = on" in keep + assert "if (!on) { stopService(service); return }" in keep + assert "startForegroundService(service)" in keep assert activity.count("keepVisible =") == 1, "the page is kept visible from one place only" view = _read(SRC / "shell" / "ShellWebView.kt") assert "var keepVisible = false" in view -- cgit v1.2.3