Set correct stack before restoring tasks

When restoring a task when starting it from recents, we need to set
all the relevant state for the transition before we actually restore
the task and attach the docked stack, as all kinds of weird things
might go wrong otherwise.

Bug: 28194162
Bug: 27607141
Change-Id: I21d173a43c62d425e507e8cc3a1a576f95cfe048
1 file changed