From 6e51bca31e67773b83b82ec26ca6720301efc4bb Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Wed, 7 Dec 2022 21:46:26 +0800 Subject: [PATCH] Only apply crop to task and task fragment in end transition If asTaskFragment() is null, the window container can be DisplayContent, DisplayArea, WindowToken, ActivityRecord. Because DisplayArea and WindowToken rely on DisplayContent, while ActivityRecord relies on task, only the parent container of activity needs the crop. Otherwise such as WallpaperWindowToken may be cropped unexpectedly if it has a rotation transform. Fix: 261704203 Test: Enable shell transition. Launch landscape app and back to portrait home. Wallpaper should not be half black. Change-Id: Id262090c64814370e3f215acdf670d7b4d6ee1e9 --- services/core/java/com/android/server/wm/Transition.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java index e49fc2512002e..f546b435e6973 100644 --- a/services/core/java/com/android/server/wm/Transition.java +++ b/services/core/java/com/android/server/wm/Transition.java @@ -643,7 +643,7 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { // No need to clip the display in case seeing the clipped content when during the // display rotation. No need to clip activities because they rely on clipping on // task layers. - if (target.asDisplayContent() != null || target.asActivityRecord() != null) { + if (target.asTaskFragment() == null) { t.setCrop(targetLeash, null /* crop */); } else { // Crop to the resolved override bounds.