feat(session): explain paused sessions and offer stop

This commit is contained in:
xXJsonDeruloXx committed 2026-09-26 16:42:28 -04:00
1 parent 5ebafaabda
commit 5d5b45a012
3 files changed
+65 -14

No files matched your search

@@ -355,9 +355,12 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
onComponentsRefresh = { refreshDrawerComponents() },
onComponentSwap = { pid, comp, value -> swapDrawerComponent(pid, comp, value) },
))
if (SessionState.suspended) SessionPausedOverlay {
SessionService.resume(this@SessionActivity)
}
if (SessionState.suspended) SessionPausedOverlay(
title = pausedTitle(),
onResume = { SessionService.resume(this@SessionActivity) },
// As the drawer's Stop does; stopping resumes the paused processes first.
onStop = { SessionService.stop(this@SessionActivity); finish() },
)
}
}
}
@@ -475,6 +478,12 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
if (SessionState.running) SessionState.mode
else intent.getStringExtra(SessionService.EXTRA_MODE) ?: SessionService.MODE_STEAM
private fun pausedTitle(): String = when (SessionState.mode) {
SessionService.MODE_DESKTOP -> "The desktop is paused"
SessionService.MODE_RUN -> (com.droiddeck.launcher.frontend.Library.nameForProgram(SessionState.program) ?: "The program") + " is paused"
else -> "Steam is paused"
}
private fun loadingTitle(): String = when (loadingMode()) {
SessionService.MODE_DESKTOP ->
if (!SessionState.running && intent.getStringExtra(SessionService.EXTRA_STEAM_UI) != null) "Starting Steam on the desktop"