Skip to content
Commit bc7b86dc authored by David Samuelson's avatar David Samuelson
Browse files

Ensure GameSession is not destroyed when restarting game.

Previously when restarting the game via `GameSession.restartGame()` the
assocaited GameSession would be destroyed, and then quickly recreated as
the game's task was reported as removed and created (via
TaskStackListener). In addition, any Activities that were in the task
stack of the game where not removed, leading to the newly launched
game's Activity to be placed above them in the task stack. This could
led to lead to strange behavior, as it is expected that  the game's
Activity to be the lowest in the task stack. For example, closing the
game's Activity would not close the task as the user would expect,
instead revealing the previously launched Activites below it.

To fix this issue, when restarting the game via
`GameSession.restartGame` the game's task stack is no longer changed.
Instead the game's Activity (and process) is restarted. As an added
benifit this solution also gives the game an opportunity to save their
instance state.

Test: Manually verified
Bug: 228842686
Bug: 202414447
Bug: 202417255

Change-Id: Iaf66de05ad6198f4f4ba4f526c171b83fcba234a
parent f71832b4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment