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

Commit 2be760d4 authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Clean-up starting window if resuming activity in another stack

We currently remove starting windows for initializing activities if we are
resuming another activity in the same stack. However, the starting window
can be orphaned if we are resuming an activity in a different stack and
start another activity in the stack with the starting window in the paused
state at the same time.
We now remove starting windowing for initializing activities that aren't
the top activity in the stack regardless of the stack we are resuming an
activity in.

Bug: 26659857
Change-Id: I6081d52d0c4c0d3556201346cfda7a38e4d02c8e
parent 7caa0b87
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1902,7 +1902,7 @@ final class ActivityStack {
            return false;
            return false;
        }
        }


        cancelInitializingActivities();
        mStackSupervisor.cancelInitializingActivities();


        // Find the first activity that is not finishing.
        // Find the first activity that is not finishing.
        final ActivityRecord next = topRunningActivityLocked();
        final ActivityRecord next = topRunningActivityLocked();
+9 −0
Original line number Original line Diff line number Diff line
@@ -908,6 +908,15 @@ public final class ActivityStackSupervisor implements DisplayListener {
        }
        }
    }
    }


    void cancelInitializingActivities() {
        for (int displayNdx = mActivityDisplays.size() - 1; displayNdx >= 0; --displayNdx) {
            ArrayList<ActivityStack> stacks = mActivityDisplays.valueAt(displayNdx).mStacks;
            for (int stackNdx = stacks.size() - 1; stackNdx >= 0; --stackNdx) {
                stacks.get(stackNdx).cancelInitializingActivities();
            }
        }
    }

    void reportActivityVisibleLocked(ActivityRecord r) {
    void reportActivityVisibleLocked(ActivityRecord r) {
        sendWaitingVisibleReportLocked(r);
        sendWaitingVisibleReportLocked(r);
    }
    }