Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2bef8ada authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Consolidate ActivityRecord#completeFinishing checking"

parents 7781e70c 50b81545
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1853,9 +1853,14 @@ final class ActivityRecord extends ConfigurationContainer {
        final ActivityRecord next = getDisplay().topRunningActivity(
                true /* considerKeyguardState */);
        final boolean isVisible = visible || nowVisible;
        // isNextNotYetVisible is to check if the next activity is invisible, or it has been
        // requested to be invisible but its windows haven't reported as invisible.  If so, it
        // implied that the current finishing activity should be added into stopping list rather
        // than destroy immediately.
        final boolean isNextNotYetVisible = next != null && (!next.nowVisible || !next.visible);
        final ActivityStack stack = getActivityStack();
        final boolean notFocusedStack = stack != mRootActivityContainer.getTopDisplayFocusedStack();
        if (isVisible && next != null && !next.nowVisible) {
        if (isVisible && isNextNotYetVisible) {
            addToStopping(false /* scheduleIdle */, false /* idleDelayed */,
                    "completeFinishing");
            if (DEBUG_STATES) {
+1 −0
Original line number Diff line number Diff line
@@ -1060,6 +1060,7 @@ public class ActivityRecordTests extends ActivityTestsBase {
        // simulates finishing in non-focused stack in split-screen.
        final ActivityStack stack = new StackBuilder(mRootActivityContainer).build();
        stack.getChildAt(0).getChildAt(0).nowVisible = true;
        stack.getChildAt(0).getChildAt(0).visible = true;

        topActivity.completeFinishing("test");