Merge "Consolidate ActivityStack#finishCurrentActivityLocked checking"
am: 1b90887629
Change-Id: Icbcdb2d841fd52306f067c7606b78918c6f70894
This commit is contained in:
@@ -4112,9 +4112,13 @@ class ActivityStack extends ConfigurationContainer {
|
|||||||
final ActivityDisplay display = getDisplay();
|
final ActivityDisplay display = getDisplay();
|
||||||
final ActivityRecord next = display.topRunningActivity(true /* considerKeyguardState */);
|
final ActivityRecord next = display.topRunningActivity(true /* considerKeyguardState */);
|
||||||
final boolean isFloating = r.getConfiguration().windowConfiguration.tasksAreFloating();
|
final boolean isFloating = r.getConfiguration().windowConfiguration.tasksAreFloating();
|
||||||
|
// isNextNotYetVisible is to check if the next activity is invisible, or it has been
|
||||||
if (mode == FINISH_AFTER_VISIBLE && (r.visible || r.nowVisible)
|
// requested to be invisible but its windows haven't reported as invisible. If so, it
|
||||||
&& next != null && !next.nowVisible && !isFloating) {
|
// implied that the current finishing activity should be added into stopping list rather
|
||||||
|
// than destroying it immediately.
|
||||||
|
final boolean isNextNotYetVisible = next != null && (!next.nowVisible || !next.visible);
|
||||||
|
if (mode == FINISH_AFTER_VISIBLE && (r.visible || r.nowVisible) && isNextNotYetVisible
|
||||||
|
&& !isFloating) {
|
||||||
if (!mStackSupervisor.mStoppingActivities.contains(r)) {
|
if (!mStackSupervisor.mStoppingActivities.contains(r)) {
|
||||||
addToStopping(r, false /* scheduleIdle */, false /* idleDelayed */,
|
addToStopping(r, false /* scheduleIdle */, false /* idleDelayed */,
|
||||||
"finishCurrentActivityLocked");
|
"finishCurrentActivityLocked");
|
||||||
|
|||||||
Reference in New Issue
Block a user