Avoid OOM Adj update for processes with fixed adj.

Ignore the oomAdjUpdate request if the target app is
system/persistent process with fixed adj.

Bug: 226385494
Test: atest MockingOomAdjusterTests
Change-Id: I796298cd6877577394960d944112c843f0a637cc
(cherry picked from commit 3bb2c5e396)
This commit is contained in:
Xin Guan
2023-04-06 14:16:27 +00:00
parent 7229904e7c
commit aca67768d3

View File

@@ -837,7 +837,7 @@ public class OomAdjuster {
*/
@GuardedBy("mService")
void enqueueOomAdjTargetLocked(ProcessRecord app) {
if (app != null) {
if (app != null && app.mState.getMaxAdj() > FOREGROUND_APP_ADJ) {
mPendingProcessSet.add(app);
}
}