fix(session): Home suspends a game another app launched, so Cocoon can resume it (#2919)

* fix(session): Home suspends a game another app launched, so Cocoon can resume it

A game launched from another front end (Cocoon, ES-DE, Daijisho...) or a
home-screen shortcut went into picture in picture on Home. Cocoon brings a
suspended player back by moving its task to the front, which Android ignores
for a task in picture in picture, and the floating game covered Cocoon's
Resume/Close bar. The game kept running instead of suspending, Cocoon's
Resume did nothing, and the only way back was the picture itself.

Automatic picture in picture now applies only to games DroidDeck launched
itself. For games launched by another app (the existing returnHome launch),
Home suspends the session, which is what Cocoon expects. The picture in
picture button still works for those games.

* fix(session): a new launch intent refreshes the automatic picture in picture rule at once
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-11-20 01:37:02 -05:00
1 parent a29315f7e0
commit 56986b5999
4 files changed
+18 -2

No files matched your search

@@ -1028,7 +1028,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
kotlinx.coroutines.delay(2000)
}
}
pip = com.droiddeck.launcher.session.SessionPipController(this, ::pipBounds, ::showPipUi)
pip = com.droiddeck.launcher.session.SessionPipController(this, ::pipBounds, ::showPipUi) {
intent.getBooleanExtra(EXTRA_RETURN_HOME, false)
}
surfaceView.addOnLayoutChangeListener { _, _, _, _, _, _, _, _, _ -> pip.refresh() }
pip.refresh()
handleHomeGuideIntent(intent)
@@ -5705,6 +5707,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
if (this.intent.getBooleanExtra(EXTRA_RETURN_HOME, false)) intent.putExtra(EXTRA_RETURN_HOME, true)
if (!intent.hasExtra(EXTRA_LINK_TASK)) intent.putExtra(EXTRA_LINK_TASK, this.intent.getIntExtra(EXTRA_LINK_TASK, -1))
setIntent(intent)
if (::pip.isInitialized) pip.refresh(true)
if (intent.getBooleanExtra(EXTRA_STEAMVR, false) && SessionState.mode == SessionService.MODE_STEAM) {
SessionState.steamVr = true
steamVrAutoTried = false