diff options
| author | 2023-07-24 10:32:06 +0000 | |
|---|---|---|
| committer | 2023-12-01 05:33:14 +0000 | |
| commit | 7d7348db13d82959e20f86f852fffc7223471bb2 (patch) | |
| tree | 618b0f4ca247218bb0610a201da6310ffc68d8a8 | |
| parent | 0afdfc6544f1882d5382cba1edda68f177c14100 (diff) | |
Skip sync invisible & lifecycle-unlreated window for an Activity.
Client can create extra window and set it's visibility to INVISIBLE or
GONE, for either case, the client won't redraw this window after
request sync, which can cause sync timeout.
To preventing from the timeout issue, skip sync that window during
prepareSync.
Bug: 285818330
Test: atest WindowOrganizerTests WindowStateTests
Test: create a window and set it's visibility to GONE, verify that
activity transition won't be blocked on waiting for this kind of window.
Change-Id: Ie8ccf1d9b8629a60943726cf3c2b8daad84fe08c
(cherry picked from commit 2c5d7bbaaf85e59c815816d7669862c2d887f459)
| -rw-r--r-- | services/core/java/com/android/server/wm/WindowState.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java index 06978a5338ea..c4506d59c138 100644 --- a/services/core/java/com/android/server/wm/WindowState.java +++ b/services/core/java/com/android/server/wm/WindowState.java @@ -5664,6 +5664,12 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP // TODO(b/233286785): Add sync support to wallpaper. return false; } + if (mActivityRecord != null && mViewVisibility != View.VISIBLE + && mWinAnimator.mAttrType != TYPE_BASE_APPLICATION + && mWinAnimator.mAttrType != TYPE_APPLICATION_STARTING) { + // Skip sync for invisible app windows which are not managed by activity lifecycle. + return false; + } // In the WindowContainer implementation we immediately mark ready // since a generic WindowContainer only needs to wait for its // children to finish and is immediately ready from its own |