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

Commit ed51d70d authored by Colin Cross's avatar Colin Cross Committed by Android (Google) Code Review
Browse files

Merge "ActivityManager: pass the main uid of the app to lmkd"

parents 7f3c084c d908edd8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15952,7 +15952,7 @@ public final class ActivityManagerService extends ActivityManagerNative
        int changes = 0;
        if (app.curAdj != app.setAdj) {
            ProcessList.setOomAdj(app.pid, app.curAdj);
            ProcessList.setOomAdj(app.pid, app.info.uid, app.curAdj);
            if (DEBUG_SWITCH || DEBUG_OOM_ADJ) Slog.v(
                TAG, "Set " + app.pid + " " + app.processName +
                " adj " + app.curAdj + ": " + app.adjType);
+4 −2
Original line number Diff line number Diff line
@@ -519,17 +519,19 @@ final class ProcessList {
     * Set the out-of-memory badness adjustment for a process.
     *
     * @param pid The process identifier to set.
     * @param uid The uid of the app
     * @param amt Adjustment value -- lmkd allows -16 to +15.
     *
     * {@hide}
     */
    public static final void setOomAdj(int pid, int amt) {
    public static final void setOomAdj(int pid, int uid, int amt) {
        if (amt == UNKNOWN_ADJ)
            return;

        ByteBuffer buf = ByteBuffer.allocate(4 * 3);
        ByteBuffer buf = ByteBuffer.allocate(4 * 4);
        buf.putInt(LMK_PROCPRIO);
        buf.putInt(pid);
        buf.putInt(uid);
        buf.putInt(amt);
        writeLmkd(buf);
    }