Finish noHistory activities immediately after resumed activity shown.

Previously, we were waiting for the newly resumed activity to become
idle before cleaning up stopping activities. However, if an activity
does not enter idle, this will be delayed until idle timeout. This
behavior causes the noHistory flag to not be honored as described.

This changelist addresses the issue by waiting for window visible,
rather than activity idle, before cleaning up noHistory activities.

Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerActivityVisibilityTests#testNoHistoryActivityFinishedResumedActivityNotIdle
Change-Id: I827d94816d307ec455a30d933a2255bf61739b3d
Fixes: 37234980
2 files changed