diff options
| author | 2018-07-27 02:34:09 +0000 | |
|---|---|---|
| committer | 2018-07-27 02:34:09 +0000 | |
| commit | 24a683ec0994ff930b95f4ccf5ea8ecc38dd9221 (patch) | |
| tree | bd0498a070133ac76b44f69aa2af70c90326e35d | |
| parent | 84bac8eae35863faadcf18368926c9b710d5f4d4 (diff) | |
| parent | afc15834eb9f75863b34cf5370bad71c32b14a73 (diff) | |
Merge "Ensure not to kill process when there's non-killable activity"
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityStackSupervisor.java | 2 | ||||
| -rw-r--r-- | services/core/java/com/android/server/am/WindowProcessController.java | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java index 41a7e9e7dff4..b08efde051b7 100644 --- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java +++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java @@ -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; } diff --git a/services/core/java/com/android/server/am/WindowProcessController.java b/services/core/java/com/android/server/am/WindowProcessController.java index 817905a5e3d4..6f3fb8eb9b72 100644 --- a/services/core/java/com/android/server/am/WindowProcessController.java +++ b/services/core/java/com/android/server/am/WindowProcessController.java @@ -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. |