From e1c25dbb4b995476aadcec3ad470904161779843 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Wed, 5 Jul 2023 09:06:22 +0000 Subject: [PATCH] Exclude screen decoration overlay from transition participants It doesn't need an animation and its surface layer should not be changed by transition. Bug: 288726181 Test: Switch screen size by "Settings > Display > Screen resolution" or "Display size and text > Display size". Check "adb shell dumpsys SurfaceFlinger | grep -A10 ScreenDecor" The parent of ScreenDecor's should be none (root). And ScreenDecor doesn't move to "Offscreen Layers". Change-Id: Ib5262f6d4be3aac4f83a82bd9e93bad7437ef640 --- services/core/java/com/android/server/wm/Transition.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java index 1b27bb17f5994..638d99d0ecc79 100644 --- a/services/core/java/com/android/server/wm/Transition.java +++ b/services/core/java/com/android/server/wm/Transition.java @@ -619,6 +619,12 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { if (!isInTransientHide(wc)) { mSyncEngine.addToSyncSet(mSyncId, wc); } + if (wc.asWindowToken() != null && wc.asWindowToken().mRoundedCornerOverlay) { + // Only need to sync the transaction (SyncSet) without ChangeInfo because cutout and + // rounded corner overlay never need animations. Especially their surfaces may be put + // in root (null, see WindowToken#makeSurface()) that cannot reparent. + return; + } ChangeInfo info = mChanges.get(wc); if (info == null) { info = new ChangeInfo(wc);