diff options
| author | 2023-06-10 00:12:40 +0000 | |
|---|---|---|
| committer | 2023-06-10 00:12:40 +0000 | |
| commit | c3866fca925a811c900bc6ed25e0e19fbfffc52b (patch) | |
| tree | 9412b1e12325a5e5f3436b827a649f5f9beeaa72 | |
| parent | d23965b75ef4c07dba595068dc481ceecc6bdb28 (diff) | |
| parent | f1da8d2ae3c6ce574b5735c9425160763e57e68f (diff) | |
Merge "Do not reuse the same ProcessRecord if it's not fully gone yet" into udc-dev am: 32db01a1a0 am: f1da8d2ae3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23638571
Change-Id: Ib62b9a03297ce0ffe67e301e8d29811e1b383043
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/core/java/com/android/server/am/ProcessList.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java index 86b09ab41ce9..c5776d822c8f 100644 --- a/services/core/java/com/android/server/am/ProcessList.java +++ b/services/core/java/com/android/server/am/ProcessList.java @@ -2572,9 +2572,14 @@ public final class ProcessList { // and did the cleanup before the actual death notification. Check the dying processes. predecessor = mDyingProcesses.get(processName, info.uid); if (predecessor != null) { - if (app != null) { + // The process record could have existed but its pid is set to 0. In this case, + // the 'app' and 'predecessor' could end up pointing to the same instance; + // so make sure we check this case here. + if (app != null && app != predecessor) { app.mPredecessor = predecessor; predecessor.mSuccessor = app; + } else { + app = null; } Slog.w(TAG_PROCESSES, predecessor.toString() + " is attached to a previous process " + predecessor.getDyingPid()); @@ -5195,6 +5200,8 @@ public final class ProcessList { mDyingProcesses.remove(app.processName, app.uid); app.setDyingPid(0); handlePrecedingAppDiedLocked(app); + // Remove from the LRU list if it's still there. + removeLruProcessLocked(app); return true; } return false; |