Cherry pick task movement changes from aosp

The following cherry picks from aosp contain code that keep windows
tracking the task movement.

https://android-review.googlesource.com/#/c/111380/
https://android-review.googlesource.com/#/c/109930

Maybe fixes bug 15729183.

Change-Id: Ida69fe365b06025d119e32b22a8d04958cdbabf3
2 files changed