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
Loading
Please register or sign in to comment