Consider destruction of activity for task removal

... from organizer.

This aligns the behavior of display removal, that removes the
container until its children are destroyed without forcing.
In other words, the task requested to be removed will be
removed when the last activity belonging to the task reports
it has done the destruction. This also avoids the case that
the activity was removed from hierarchy but window process
controller still references to it, which will cause NPE in
ActivityRecord#cleanup.

Besides, adopt the hierarchical defer removal to task fragment
level (handleCompleteDeferredRemoval), so if it has something
animating, it will be removed until the animation is done.

Also
 - Fine tune some dump formats.
 - Fix wrong parent when removing child of non-root task.
 - Remove hasWindowsAlive because the window hierarchy was
   unified that app window belongs to activity directly.

Bug: 195770030
Test: TaskTests#testRemoveContainer
      ActivityRecordTests#testRemoveImmediately

Change-Id: Iddf0c4838103f36f40b8b4a7354ecd4c69a70200
10 files changed