From ac54d3cccaa79b768d8b4fad9d7737fcee5d7d2f Mon Sep 17 00:00:00 2001 From: wanghuadong Date: Wed, 16 Oct 2024 21:21:48 +0800 Subject: Remove StartingWindow or cancel the request to add StartingWindow after all activities have been drawn In Embedded mode, all activities have already been drawn before the addition of StartingWindow is completed, then there is no suitable time to remove StartingWindow. So when all activities have been drawn but StartingWindow has not been successfully added, we need to cancel the request to add StartingWindow Bug: 373802899 Change-Id: I4e98947ad305a3434ee22b12612b76f0e0578e96 Signed-off-by: wanghuadong --- services/core/java/com/android/server/wm/ActivityRecord.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java index a076cf6bf6ab..3bca2d8e9957 100644 --- a/services/core/java/com/android/server/wm/ActivityRecord.java +++ b/services/core/java/com/android/server/wm/ActivityRecord.java @@ -6960,7 +6960,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } else if (associatedTask.getActivity( r -> r.isVisibleRequested() && !r.firstWindowDrawn) == null) { // The last drawn activity may not be the one that owns the starting window. - final ActivityRecord r = associatedTask.topActivityContainsStartingWindow(); + final ActivityRecord r = associatedTask.getActivity(ar -> ar.mStartingData != null); if (r != null) { r.removeStartingWindow(); } -- cgit v1.2.3-59-g8ed1b