Fixed some activity visiblility issues in picture-in-picutre mode

- Previously when don't re-launch an activity due to configuration
change if the activity is currently pausing. And, once the pause is
complete we destroy the activity. This logic is based on the assumption
that all activities are fullscreen and pausing is the same as stopping
which means the activity is no longer visible and can be destoried.
This assumption is not true in multi-window mode where you can have
visible activities in the paused state.
We now relaunch the activity once it is done pausing.

- Previously we set the return type of the top task in a stack to home
if the previously focused stack is home while add the task to the stack.
This logic is based on the assumption that the focus stack is the front
stack which isn't true for pinned stack. This causes an activity behind
the top translucent activity in the pinned stack to be marked as invisible
and stopped since the top task is over the home task so we should be
showing the home task behind it and not other tasks in the stack.
We now set the return to task type to application type for task added to
the pinned stack.

Bug: 26273032
Change-Id: I0ffac81f46c57e2d0d900db3417381f059aee7ea
4 files changed