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

Commit d3ad2a6c authored by Maunik Shah's avatar Maunik Shah Committed by Steve Kondik
Browse files

Avoid IndexOutOfBounds Exception in ActivityManager

Bypass the iteration to avoid the exception during
the execution of ensureActivityVisibleLocked() because
startSpecificActivityLocked() within for loop may delete
the elements from History stack.

Change-Id: Iad9bdc6521b25b12d4c67e6b89f375a99b17748b
CRs-Fixed: 535900
parent 1de8fb28
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1308,6 +1308,10 @@ final class ActivityStack {
        ActivityRecord r;
        boolean behindFullscreen = false;
        for (; i>=0; i--) {
            // To make sure index is valid as there might be the case when size of
            // the history stack gets decremented within this for loop.
            if (i >= mHistory.size())
                continue;
            r = mHistory.get(i);
            if (DEBUG_VISBILITY) Slog.v(
                    TAG, "Make visible? " + r + " finishing=" + r.finishing