mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 12:28:40 +00:00
A game started from another launcher (ES-DE, a `droiddeck://game/` link, a pinned shortcut) should send the player back to that launcher when it closes. Instead DroidDeck always opened the Android home screen, which is a different place whenever that launcher isn't the default Home app. ## Cause The link is handled by `FrontEndActivity`, which starts the session in its own task and stays behind it in a second DroidDeck task. When the session ended, DroidDeck started `CATEGORY_HOME` to cover that leftover task, so the player always landed on the system Home. ## Fix When a link-launched session ends, `SessionActivity` removes the task that handled the link (a `FrontEndActivity` task whose base intent is a game link), then removes its own task. Android then shows whatever was underneath: ES-DE, any other app that launched the game, or Home when Home launched it. Sessions started from DroidDeck's own Games tab are unchanged. ## Testing On a REDMAGIC NP06J, with the `droiddeck://game/945360` link started using ES-DE's flags (`NEW_TASK | CLEAR_TASK`). Among Us was closed and "Return to launcher after a game" was on. | Launched from | main | this branch | |---|---|---| | Calculator (stands in for a non-Home frontend) | Android home | Calculator | | Home | Android home | Android home | | DroidDeck's Games tab | DroidDeck | DroidDeck | ## Credits Reported on Discord by whatsupbros.