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

Commit 1e7aefbe authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Update the order in which we apply new proc_state/oom_adj values.

We check if the network blocked state (which depends on proc_state)
of an uid changed and update a seq counter to keep track of that.
We need to do this before the newly computed proc_state/oom_adj
values are applied. It used to be like this earlier but seems there
was a regression.

Fixes: 181013898
Test: atest ./tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java
Test: atest ./services/tests/servicestests/src/com/android/server/am/ActivityManagerServiceTest.java
Test: atest ./services/tests/servicestests/src/com/android/server/am/OomAdjusterTests.java
Test: atest ./tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java
Change-Id: Ib5b26c82495856a83cbe6d76594e7503ae37f98c
parent e7dfae7e
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -486,8 +486,6 @@ public final class OomAdjuster {

        computeOomAdjLSP(app, cachedAdj, TOP_APP, doingAll, now, false, true);

        boolean success = applyOomAdjLSP(app, doingAll, now, SystemClock.elapsedRealtime());

        if (uidRec != null) {
            // After uidRec.reset() above, for UidRecord with multiple processes (ProcessRecord),
            // we need to apply all ProcessRecord into UidRecord.
@@ -504,7 +502,7 @@ public final class OomAdjuster {
            }
        }

        return success;
        return applyOomAdjLSP(app, doingAll, now, SystemClock.elapsedRealtime());
    }

    /**