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

Commit 24a683ec authored by Yunfan Chen's avatar Yunfan Chen Committed by Android (Google) Code Review
Browse files

Merge "Ensure not to kill process when there's non-killable activity"

parents 84bac8ea afc15834
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3181,7 +3181,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D

                if (!proc.shouldKillProcessForRemovedTask(tr)) {
                    // Don't kill process(es) that has an activity in a different task that is also
                    // in recents.
                    // in recents, or has an activity not stopped.
                    return;
                }

+6 −1
Original line number Diff line number Diff line
@@ -334,7 +334,12 @@ public class WindowProcessController {

    boolean shouldKillProcessForRemovedTask(TaskRecord tr) {
        for (int k = 0; k < mActivities.size(); k++) {
            final TaskRecord otherTask = mActivities.get(k).getTask();
            final ActivityRecord activity = mActivities.get(k);
            if (!activity.stopped) {
                // Don't kill process(es) that has an activity not stopped.
                return false;
            }
            final TaskRecord otherTask = activity.getTask();
            if (tr.taskId != otherTask.taskId && otherTask.inRecents) {
                // Don't kill process(es) that has an activity in a different task that is
                // also in recents.