Set fullscreen mode to task at the end of exit-pip animation

This restores to legacy behavior for pip-to-fullscreen:
 Animation starts: set activity to fullscreen
 Animation ends: set task to fullscreen
Otherwise the app will receive the callbacks immediately:
(see ActivityRecord#canReceiveKeys,isFocusable,
 Task#onConfigurationChangedInner
 TaskSupervisor#scheduleUpdatePictureInPictureModeIfNeeded)
 - onResumed
 - onWindowFocusChanged
 - onPictureInPictureModeChanged
And then the app may trigger more actions to disturb the
animation, e.g. toggle global UI mode, start/finish activity,
change requested orientation.

Another approach is to add workaround in WM core to skip the
events if the activity is in exit-pip transition, and then
invoke them at the end of transition.

Bug: 273177981
Test: Expand PiP to fullscreen, the lifecycle callbacks of the
      PiP are called at the end of animation.
Change-Id: Ia9a17c6ea471016c28bfc10afeb37cc13e6c0999
3 files changed