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

Commit 130a9080 authored by Michael Wachenschwanz's avatar Michael Wachenschwanz
Browse files

Note partial/full to OomAdjuster's postUpdateOomAdjInnerLSP

ProcessTrackerState gets updated in applyOomAdjLSP only for partial
updates. Since the new partial update goes through
postUpdateOomAdjInnerLSP to trigger applyOomAdjLSP, it needs to be aware
of what type of update it is.

Fixes: 328570084
Test: atest CtsStatsdAtomHostTestCases:android.cts.statsdatom.perf.ProcStatsTests
Change-Id: Iab1e5bd017e98c492c5d589d0357470e9ee8e2b3
parent d79b6e46
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -1051,7 +1051,7 @@ public class OomAdjuster {

        assignCachedAdjIfNecessary(mProcessList.getLruProcessesLOSP());

        postUpdateOomAdjInnerLSP(oomAdjReason, activeUids, now, nowElapsed, oldTime);
        postUpdateOomAdjInnerLSP(oomAdjReason, activeUids, now, nowElapsed, oldTime, true);

        if (startProfiling) {
            mService.mOomAdjProfiler.oomAdjEnded();
@@ -1073,12 +1073,12 @@ public class OomAdjuster {

    @GuardedBy({"mService", "mProcLock"})
    protected void postUpdateOomAdjInnerLSP(@OomAdjReason int oomAdjReason, ActiveUids activeUids,
            long now, long nowElapsed, long oldTime) {
            long now, long nowElapsed, long oldTime, boolean doingAll) {
        mNumNonCachedProcs = 0;
        mNumCachedHiddenProcs = 0;

        final boolean allChanged = updateAndTrimProcessLSP(now, nowElapsed, oldTime, activeUids,
                oomAdjReason);
                oomAdjReason, doingAll);
        mNumServiceProcs = mNewNumServiceProcs;

        if (mService.mAlwaysFinishActivities) {
@@ -1288,7 +1288,8 @@ public class OomAdjuster {

    @GuardedBy({"mService", "mProcLock"})
    private boolean updateAndTrimProcessLSP(final long now, final long nowElapsed,
            final long oldTime, final ActiveUids activeUids, @OomAdjReason int oomAdjReason) {
            final long oldTime, final ActiveUids activeUids, @OomAdjReason int oomAdjReason,
            boolean doingAll) {
        ArrayList<ProcessRecord> lruList = mProcessList.getLruProcessesLOSP();
        final int numLru = lruList.size();

@@ -1321,7 +1322,7 @@ public class OomAdjuster {
            if (!app.isKilledByAm() && app.getThread() != null) {
                // We don't need to apply the update for the process which didn't get computed
                if (state.getCompletedAdjSeq() == mAdjSeq) {
                    applyOomAdjLSP(app, true, now, nowElapsed, oomAdjReason);
                    applyOomAdjLSP(app, doingAll, now, nowElapsed, oomAdjReason);
                }

                if (app.isPendingFinishAttach()) {
+2 −2
Original line number Diff line number Diff line
@@ -820,7 +820,7 @@ public class OomAdjusterModernImpl extends OomAdjuster {
        computeConnectionsLSP();

        assignCachedAdjIfNecessary(mProcessList.getLruProcessesLOSP());
        postUpdateOomAdjInnerLSP(oomAdjReason, mActiveUids, now, nowElapsed, oldTime);
        postUpdateOomAdjInnerLSP(oomAdjReason, mActiveUids, now, nowElapsed, oldTime, true);
    }

    /**
@@ -908,7 +908,7 @@ public class OomAdjusterModernImpl extends OomAdjuster {
            }
        }

        postUpdateOomAdjInnerLSP(oomAdjReason, activeUids, now, nowElapsed, oldTime);
        postUpdateOomAdjInnerLSP(oomAdjReason, activeUids, now, nowElapsed, oldTime, false);
    }

    /**