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

Commit e302462c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove CPU_TIME for core processes." into main

parents 97ea4d5a 86e5a61e
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -156,7 +156,6 @@ import android.os.Process;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.Slog;
@@ -3401,15 +3400,12 @@ public class OomAdjuster {
    }

    private static int getCpuCapability(ProcessRecord app, long nowUptime) {
        // Note: persistent processes get all capabilities, including CPU_TIME.
        final UidRecord uidRec = app.getUidRecord();
        if (uidRec != null && uidRec.isCurAllowListed()) {
            // Process is in the power allowlist.
            return PROCESS_CAPABILITY_CPU_TIME;
        }
        if (UserHandle.isCore(app.uid)) {
            // Make sure all system components are not frozen.
            return PROCESS_CAPABILITY_CPU_TIME;
        }
        if (app.mState.getCachedHasVisibleActivities()) {
            // Process has user visible activities.
            return PROCESS_CAPABILITY_CPU_TIME;