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

Commit 19c3b5d0 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Work on issue #17581375: Nexus 5 getting low on RAM" into lmp-dev

parents 3119b82c d4125639
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -2623,6 +2623,11 @@ public final class ActivityManagerService extends ActivityManagerNative
    final void removeLruProcessLocked(ProcessRecord app) {
        int lrui = mLruProcesses.lastIndexOf(app);
        if (lrui >= 0) {
            if (!app.killed) {
                Slog.wtf(TAG, "Removing process that hasn't been killed: " + app);
                Process.killProcessQuiet(app.pid);
                Process.killProcessGroup(app.info.uid, app.pid);
            }
            if (lrui <= mLruProcessActivityStart) {
                mLruProcessActivityStart--;
            }
@@ -3206,6 +3211,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            app.setPid(startResult.pid);
            app.usingWrapper = startResult.usingWrapper;
            app.removed = false;
            app.killed = false;
            app.killedByAm = false;
            checkTime(startTime, "startProcess: starting to update pids map");
            synchronized (mPidsSelfLocked) {
@@ -4804,15 +4810,16 @@ public final class ActivityManagerService extends ActivityManagerNative
       appDiedLocked(app, app.pid, app.thread);
    }
    final void appDiedLocked(ProcessRecord app, int pid,
            IApplicationThread thread) {
    final void appDiedLocked(ProcessRecord app, int pid, IApplicationThread thread) {
        BatteryStatsImpl stats = mBatteryStatsService.getActiveStatistics();
        synchronized (stats) {
            stats.noteProcessDiedLocked(app.info.uid, pid);
        }
        Process.killProcessQuiet(pid);
        Process.killProcessGroup(app.info.uid, pid);
        app.killed = true;
        // Clean up already done if the process has been re-started.
        if (app.pid == pid && app.thread != null &&
+5 −2
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ final class ProcessRecord {
    boolean treatLikeActivity;  // Bound using BIND_TREAT_LIKE_ACTIVITY
    boolean bad;                // True if disabled in the bad process list
    boolean killedByAm;         // True when proc has been killed by activity manager, not for RAM
    boolean killed;             // True once we know the process has been killed
    boolean procStateChanged;   // Keep track of whether we changed 'setAdj'.
    String waitingToKill;       // Process is waiting to be killed when in the bg, and reason
    IBinder forcingToForeground;// Token that is forcing this process to be foreground
@@ -303,8 +304,9 @@ final class ProcessRecord {
                pw.print(" lastLowMemory=");
                TimeUtils.formatDuration(lastLowMemory, now, pw);
                pw.print(" reportLowMemory="); pw.println(reportLowMemory);
        if (killedByAm || waitingToKill != null) {
            pw.print(prefix); pw.print("killedByAm="); pw.print(killedByAm);
        if (killed || killedByAm || waitingToKill != null) {
            pw.print(prefix); pw.print("killed="); pw.print(killed);
                    pw.print(" killedByAm="); pw.print(killedByAm);
                    pw.print(" waitingToKill="); pw.println(waitingToKill);
        }
        if (debugging || crashing || crashDialog != null || notResponding
@@ -514,6 +516,7 @@ final class ProcessRecord {
            Process.killProcessQuiet(pid);
            Process.killProcessGroup(info.uid, pid);
            if (!persistent) {
                killed = true;
                killedByAm = true;
            }
        }