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

Commit cdc4627e authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Do not update lru list for dead process"

parents 276718de f3ba6a64
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1460,6 +1460,12 @@ class ProcessRecord implements WindowProcessListener {
            if (updateServiceConnectionActivities) {
                mService.mServices.updateServiceConnectionActivitiesLocked(this);
            }
            if (thread == null) {
                // Only update lru and oom-adj if the process is alive. Because it may be called
                // when cleaning up the last activity from handling process died, the dead process
                // should not be added to lru list again.
                return;
            }
            mService.mProcessList.updateLruProcessLocked(this, activityChange, null /* client */);
            if (updateOomAdj) {
                mService.updateOomAdjLocked(this, OomAdjuster.OOM_ADJ_REASON_ACTIVITY);
+13 −6
Original line number Diff line number Diff line
@@ -1257,20 +1257,27 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
        mAtm.mStackSupervisor.removeHistoryRecords(this);

        boolean hasVisibleActivities = false;
        if (mInactiveActivities != null && !mInactiveActivities.isEmpty()) {
        final boolean hasInactiveActivities =
                mInactiveActivities != null && !mInactiveActivities.isEmpty();
        final ArrayList<ActivityRecord> activities =
                (mHasActivities || hasInactiveActivities) ? new ArrayList<>() : mActivities;
        if (mHasActivities) {
            activities.addAll(mActivities);
        }
        if (hasInactiveActivities) {
            // Make sure that all activities in this process are handled.
            mActivities.addAll(mInactiveActivities);
            activities.addAll(mInactiveActivities);
        }
        if (isRemoved()) {
            // The package of the died process should be force-stopped, so make its activities as
            // finishing to prevent the process from being started again if the next top (or being
            // visible) activity also resides in the same process. This must be done before removal.
            for (int i = mActivities.size() - 1; i >= 0; i--) {
                mActivities.get(i).makeFinishingLocked();
            for (int i = activities.size() - 1; i >= 0; i--) {
                activities.get(i).makeFinishingLocked();
            }
        }
        for (int i = mActivities.size() - 1; i >= 0; i--) {
            final ActivityRecord r = mActivities.get(i);
        for (int i = activities.size() - 1; i >= 0; i--) {
            final ActivityRecord r = activities.get(i);
            if (r.mVisibleRequested || r.isVisible()) {
                // While an activity launches a new activity, it's possible that the old activity
                // is already requested to be hidden (mVisibleRequested=false), but this visibility