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

Commit 7f13ed37 authored by Craig Mautner's avatar Craig Mautner
Browse files

Remove PendingActivityLaunches based on stack.

Was previously removing by trying to match activities, but the
activity being matched would not have been in the stack yet. Since
it doesn't get added to the stack when it goes into the list
of pending activities. By removing all pending activities associated
with the stack we clean up all such pending activities.

Fixes bug 16045752.

Change-Id: I6b5981ffcce674139837b06362e573299bbc9e52
parent ee36c77a
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -2688,7 +2688,6 @@ final class ActivityStack {
        // down to the max limit while they are still waiting to finish.
        mStackSupervisor.mFinishingActivities.remove(r);
        mStackSupervisor.mWaitingVisibleActivities.remove(r);
        mStackSupervisor.removePendingActivityLaunchesLocked(r);

        // Remove any pending results.
        if (r.finishing && r.pendingResults != null) {
+3 −2
Original line number Diff line number Diff line
@@ -1859,10 +1859,10 @@ public final class ActivityStackSupervisor implements DisplayListener {
        }
    }

    void removePendingActivityLaunchesLocked(ActivityRecord r) {
    void removePendingActivityLaunchesLocked(ActivityStack stack) {
        for (int palNdx = mPendingActivityLaunches.size() - 1; palNdx >= 0; --palNdx) {
            PendingActivityLaunch pal = mPendingActivityLaunches.get(palNdx);
            if (pal.r == r) {
            if (pal.stack == stack) {
                mPendingActivityLaunches.remove(palNdx);
            }
        }
@@ -3099,6 +3099,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
                long origId = Binder.clearCallingIdentity();
                try {
                    mStack.finishAllActivitiesLocked(false);
                    removePendingActivityLaunchesLocked(mStack);
                } finally {
                    Binder.restoreCallingIdentity(origId);
                }