[Bugfix] Fix the wrong lastBackgroundTime in UidRecord

Test:A process call into updateOomAdjLocked in background
which will set its uidRec.lastBackgroundTime = SystemClock.uptimeMillis();
and then in the idleUidsLocked() method it will compare the
lastBackgroundTime with the elapsedRealtime which may cause a
process which just go into background a few seconds ago become
idle state and then be killed by this

Change-Id: I419a555ef2f6490c26290b19fc86756fde293551
Signed-off-by: lihuan3 <lihuan3@xiaomi.com>
This commit is contained in:
lihuan3
2020-12-25 16:09:41 +08:00
committed by 欢 李
parent c779768dbc
commit ecc7a0a55a

View File

@@ -387,7 +387,7 @@ public final class OomAdjuster {
ActiveUids uids = mTmpUidRecords;
uids.clear();
uids.put(uidRec.uid, uidRec);
updateUidsLocked(uids, now);
updateUidsLocked(uids, SystemClock.elapsedRealtime());
mProcessList.incrementProcStateSeqAndNotifyAppsLocked(uids);
}
}