Fix how task stack listener closes overlays on task changes.

Originally gated onTaskMovedToFront behind prototype because looked like
it was causing overlay to close when it shouldn't. However, it turns out
it was actually onTaskStackChanged that was doing this.

Additionally, changing onTaskMovedToFront to close with animation, because this will fire if swiping up from all apps (going to overview so Launcher is considered as the task moving to front). Also, registered onTaskCreated to be a bit more thorough.

Test: Manual (EDU, All Apps, and EDU + All Apps)
Fix: 283373523
Flag: none
Change-Id: I4cd3969f91a93bab190b764a656d9cfc03d1ce09
(cherry picked from commit 34c6b871afe341c7cd1ba70b590b4e2340240049)
1 file changed