Use isolated uid to set oom_score_adj

When a service is isolated, ProcessRecord.uid is different from
ProcessRecord.info.uid. We should use the former to set oom_score_adj.
Otherwize, lmkd fails to set memory.soft_limit_in_bytes for isolated
processes.

Bug: 64656396
Test: tested on gobo

Change-Id: I81fb1cf64f4680355365ad715b7c0ecd7ac560ed
This commit is contained in:
Kenichi Ishibashi
2017-08-29 11:17:29 +09:00
parent b49fa21828
commit 72be3d3753

View File

@@ -21937,7 +21937,7 @@ public class ActivityManagerService extends IActivityManager.Stub
int changes = 0;
if (app.curAdj != app.setAdj) {
ProcessList.setOomAdj(app.pid, app.info.uid, app.curAdj);
ProcessList.setOomAdj(app.pid, app.uid, app.curAdj);
if (DEBUG_SWITCH || DEBUG_OOM_ADJ) Slog.v(TAG_OOM_ADJ,
"Set " + app.pid + " " + app.processName + " adj " + app.curAdj + ": "
+ app.adjType);