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

Commit 6abcec1d authored by Olawale Ogunwale's avatar Olawale Ogunwale Committed by Android Git Automerger
Browse files

am df736de8: am d052a3d3: Merge "[ActivityManager] Fix index out of bounds...

am df736de8: am d052a3d3: Merge "[ActivityManager] Fix index out of bounds when updating next pss time."

* commit 'df736de8':
  [ActivityManager] Fix index out of bounds when updating next pss time.
parents 962a11ad df736de8
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -17669,6 +17669,10 @@ 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 == ActivityManager.PROCESS_STATE_NONEXISTENT) {
                continue;
            }
            if (memLowered || now > (app.lastStateTime+ProcessList.PSS_ALL_INTERVAL)) {
                app.pssProcState = app.setProcState;
                app.nextPssTime = ProcessList.computeNextPssTime(app.curProcState, true,
@@ -17984,8 +17988,8 @@ public final class ActivityManagerService extends ActivityManagerNative
                }
            }
        }
        if (app.setProcState < 0 || ProcessList.procStatesDifferForMem(app.curProcState,
                app.setProcState)) {
        if (app.setProcState == ActivityManager.PROCESS_STATE_NONEXISTENT
                || ProcessList.procStatesDifferForMem(app.curProcState, app.setProcState)) {
            if (false && mTestPssMode && app.setProcState >= 0 && app.lastStateTime <= (now-200)) {
                // Experimental code to more aggressively collect pss while
                // running test...  the problem is that this tends to collect
+6 −4
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.server.am;

import static android.app.ActivityManager.PROCESS_STATE_NONEXISTENT;

import android.util.ArraySet;
import android.util.EventLog;
import android.util.Slog;
@@ -83,10 +85,10 @@ final class ProcessRecord {
    int curSchedGroup;          // Currently desired scheduling class
    int setSchedGroup;          // Last set to background scheduling class
    int trimMemoryLevel;        // Last selected memory trimming level
    int curProcState = -1;      // Currently computed process state: ActivityManager.PROCESS_STATE_*
    int repProcState = -1;      // Last reported process state
    int setProcState = -1;      // Last set process state in process tracker
    int pssProcState = -1;      // The proc state we are currently requesting pss for
    int curProcState = PROCESS_STATE_NONEXISTENT; // Currently computed process state
    int repProcState = PROCESS_STATE_NONEXISTENT; // Last reported process state
    int setProcState = PROCESS_STATE_NONEXISTENT; // Last set process state in process tracker
    int pssProcState = PROCESS_STATE_NONEXISTENT; // Currently requesting pss for
    boolean serviceb;           // Process currently is on the service B list
    boolean serviceHighRam;     // We are forcing to service B list due to its RAM use
    boolean setIsForeground;    // Running foreground UI when last set?