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

Commit 9ebefe12 authored by riddle_hsu's avatar riddle_hsu Committed by Steve Kondik
Browse files

[ActivityManager] Fix index out of bounds when updating next pss time.

Symptom:
System server crash.

Root Cause:
The value curProcState for array index is -1 if the process
has not attached yet.

Solution:
Skip computing for process which is not attached or have
invalid curProcState.

Change-Id: I71aaf45bb78d73097ebe9dfebf76b72f2d243232
parent 676a5b43
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -17315,6 +17315,9 @@ public final class ActivityManagerService extends ActivityManagerNative
        mPendingPssProcesses.clear();
        for (int i=mLruProcesses.size()-1; i>=0; i--) {
            ProcessRecord app = mLruProcesses.get(i);
            if (app.thread == null || app.curProcState < 0) {
                continue;
            }
            if (memLowered || now > (app.lastStateTime+ProcessList.PSS_ALL_INTERVAL)) {
                app.pssProcState = app.setProcState;
                app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, true,