From cedb99de0dfe80bf86b9ec01a4e527ac2a781d21 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Thu, 6 Apr 2023 19:14:38 +0800 Subject: [PATCH] Do not restart process of a finishing activity The destruction operation should have higher priority. That also avoids disturbing DESTROYING state when the client reports destroyed. Currently some callers of restartProcessIfVisible such as ActivityTaskManagerInternal and TaskOrganizerController also ignore finishing activity. So this just adds a double check for the path from config change. Bug: 276467485 Test: CompatChangeTests Change-Id: Icd24147abb1d4e5859c44862ed42f4557ecb2387 --- services/core/java/com/android/server/wm/ActivityRecord.java | 1 + 1 file changed, 1 insertion(+) diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index 8346e7c83190d..9f97901e09860 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -9760,6 +9760,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A * directly with keeping its record. */ void restartProcessIfVisible() { + if (finishing) return; Slog.i(TAG, "Request to restart process of " + this); // Reset the existing override configuration so it can be updated according to the latest