Merge "Finish immediately if the resumed activity is already visible" into nyc-dev

am: 08eb8a1

* commit '08eb8a1aa2384883fd1bb0b60d3b49c4c72c3143':
  Finish immediately if the resumed activity is already visible

Change-Id: I7446e434103ee9e7473eeb0b40af6ec20aa21bfc
This commit is contained in:
Chong Zhang
2016-04-27 01:31:34 +00:00
committed by android-build-merger

View File

@@ -3457,7 +3457,8 @@ final class ActivityStack {
// First things first: if this activity is currently visible,
// and the resumed activity is not yet visible, then hold off on
// finishing until the resumed one becomes visible.
if (mode == FINISH_AFTER_VISIBLE && (r.visible || r.nowVisible)) {
if (mode == FINISH_AFTER_VISIBLE && (r.visible || r.nowVisible)
&& !mStackSupervisor.allResumedActivitiesVisible()) {
if (!mStackSupervisor.mStoppingActivities.contains(r)) {
addToStopping(r, false /* immediate */);
}