Make the adjustment of stack consistent for finishing activity

Originally when finishing an activity which is the last one in
its stack, the next stack will be moved to front only when it
is on top display.

Now the top stack on non-top display will also be moved to front,
except changing the order of display and updating focused app.
Then the visibility can be updated during resuming next. So the
ensuring visibility on the finish path is no longer needed, that
also reduces some cases unable to set correct visibility for
finishing activity.

Bug: 142020090
Test: atest ActivityRecordTests# \
            testCompleteFinishing_keepStateOfNextInvisible
      atest ActivityLifecycleTopResumedStateTests# \
            testFinishOnDifferentDisplay_nonFocused
      atest ActivityLifecycleTests# \
            testTrampolineAnotherExistingProcessNewTask

Change-Id: I1aed47e8d21ea8b3b246b5db226c3dc68b475d0b
2 files changed