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

Commit 7d664e54 authored by Jing Ji's avatar Jing Ji Committed by android-build-merger
Browse files

Merge "Proper fix for the LRU IndexOutOfBoundsException" into qt-qpr1-dev

am: afeaaa3c

Change-Id: I8995547b4c58d86b676de81fd8818de199a005e2
parents c6c6534b afeaaa3c
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -2097,10 +2097,10 @@ public final class ProcessList {
                    }
                }
            }
            if (lrui <= mLruProcessActivityStart) {
            if (lrui < mLruProcessActivityStart) {
                mLruProcessActivityStart--;
            }
            if (lrui <= mLruProcessServiceStart) {
            if (lrui < mLruProcessServiceStart) {
                mLruProcessServiceStart--;
            }
            mLruProcesses.remove(lrui);
@@ -2632,7 +2632,7 @@ public final class ProcessList {
                        if (!moved) {
                            // Goes to the end of the group.
                            mLruProcesses.remove(i);
                            mLruProcesses.add(endIndex - 1, subProc);
                            mLruProcesses.add(endIndex, subProc);
                            if (DEBUG_LRU) Slog.d(TAG_LRU,
                                    "Moving " + subProc
                                            + " from position " + i + " to end of group @ "
@@ -2877,15 +2877,6 @@ public final class ProcessList {
                    pos--;
                }
                mLruProcesses.add(pos, app);
                if (pos == mLruProcessActivityStart) {
                    mLruProcessActivityStart++;
                }
                if (pos == mLruProcessServiceStart) {
                    // Unless {@code #hasService} is implemented, currently the starting position
                    // for activity and service are the same, so the incoming position may equal to
                    // the starting position of service.
                    mLruProcessServiceStart++;
                }
                // If this process is part of a group, need to pull up any other processes
                // in that group to be with it.
                int endIndex = pos - 1;