mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 02:51:10 +00:00
fix(session): keep wake locks released under a manual hold and retry the paused frame
This commit is contained in:
1 parent
c5cd52b5c9
commit
bc094d1920
3 files changed
+6
-2
No files matched your search
@@ -3116,7 +3116,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback {
|
||||
private fun capturePausedFrame(manual: Boolean = false) {
|
||||
if (!SessionState.running || pipUi || isInPictureInPictureMode || glassesOutputActive) return
|
||||
if (SessionState.suspended && pausedFrame != null) return
|
||||
if ((suspendPolicy == SessionPrefs.SUSPEND_NEVER && !manual) || !::surfaceView.isInitialized) return
|
||||
if ((suspendPolicy == SessionPrefs.SUSPEND_NEVER && !manual && !SessionState.manualPause) || !::surfaceView.isInitialized) return
|
||||
if (surfaceView.holder.surface?.isValid != true) return
|
||||
val width = surfaceView.width
|
||||
val height = surfaceView.height
|
||||
|
||||
@@ -1556,7 +1556,7 @@ class SessionService : Service() {
|
||||
manualPauseRequested = false
|
||||
}
|
||||
val controller = suspendController ?: return
|
||||
if (downloadsBlockingSuspend) acquireLocks()
|
||||
if (downloadsBlockingSuspend && !manualHold) acquireLocks()
|
||||
val steamPause = SessionState.mode == MODE_STEAM && (manualHold || !downloadsBlockingSuspend && when (suspendPolicy) {
|
||||
SessionPrefs.SUSPEND_AUTO, SessionPrefs.SUSPEND_NATIVE -> hidden
|
||||
SessionPrefs.SUSPEND_MANUAL -> manualPauseRequested
|
||||
|
||||
@@ -109,6 +109,10 @@ fun SessionPausedOverlay(
|
||||
when {
|
||||
suspended && !engaged -> {
|
||||
if (!shown && animateIn) {
|
||||
if (currentFrame == null) {
|
||||
onFrameNeeded()
|
||||
withTimeoutOrNull(FRAME_WAIT_MS) { snapshotFlow { currentFrame }.first { it != null } }
|
||||
}
|
||||
shown = true
|
||||
launch { press.animateTo(1f, Motion.sp(0.5f, Spring.StiffnessMedium)) }
|
||||
launch { ring.animateTo(0f, Motion.tw(200)) }
|
||||
|
||||
Reference in new issue
Block a user