From 4715ae6b66b57a11ac1b10a2b87ebf8545433383 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 30 Apr 2026 22:28:33 +0000 Subject: [PATCH] Keeps the screen on while connected to a Nest room Holds FLAG_KEEP_SCREEN_ON via the existing KeepScreenOn composable while ConnectionUiState is Connected, so the device doesn't lock and interrupt an active audio-room session. --- .../loggedIn/nests/room/activity/NestActivityContent.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/activity/NestActivityContent.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/activity/NestActivityContent.kt index adbc4db11b..0c9418033e 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/activity/NestActivityContent.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/nests/room/activity/NestActivityContent.kt @@ -32,6 +32,7 @@ import com.vitorpamplona.amethyst.commons.model.AddressableNote import com.vitorpamplona.amethyst.commons.viewmodels.ConnectionUiState import com.vitorpamplona.amethyst.commons.viewmodels.NestViewModel import com.vitorpamplona.amethyst.service.relayClient.reqCommand.event.observeNoteEvent +import com.vitorpamplona.amethyst.ui.call.KeepScreenOn import com.vitorpamplona.amethyst.ui.note.LoadAddressableNote import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.nests.datasource.NestRoomFilterAssemblerSubscription @@ -176,6 +177,12 @@ private fun NestActivityBody( val ui by viewModel.uiState.collectAsState() + // Hold a screen-on lock while the user is actively in the room so the + // device doesn't lock and interrupt the audio session UI. + if (ui.connection is ConnectionUiState.Connected) { + KeepScreenOn() + } + // System bridges: PIP overlay actions + foreground service. PipBridge(ui, pipMuteSignal, viewModel, onMuteState, onConnectedChange) NestForegroundServiceLifecycle(ui)