Do not use top running activities in other tasks when reset tasks

There were no running activities left in the resetting task, because
all activities in the task were set as finishing. The next top running
activity from other tasks was selected and returning it as the new
taskTop. However, we shouldn’t return the activity that was not
belonging to the resetting task because other tasks below would be
reused for the newly starting activity.

Bug: 135033489
Test: atest ActivityStackTests

Change-Id: Ia3793cd3d65837fdbc4cd43c2639e86184f6fb15
2 files changed