From 960df119c538ebd94b7e2de6c42029bf684aa3b3 Mon Sep 17 00:00:00 2001 From: Riddle Hsu Date: Mon, 24 Mar 2025 10:29:27 +0800 Subject: Use crop method that allows invalid rect Restore to be the same as legacy WindowAnimationSpec that uses setWindowCrop as well. In case the animation's transform.getClipRect causes to an invalid rect. And setCrop will throw exception for that. But it should be fine to set invalid rect as clearing crop. Bug: 400316924 Flag: EXEMPT bugfix Test: Use makeClipRevealAnimation with invalid rect to launch app Change-Id: I8987d699f79af50f70cee545f90efb37c9f3b268 --- .../src/com/android/wm/shell/transition/DefaultSurfaceAnimator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs') diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultSurfaceAnimator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultSurfaceAnimator.java index bff08ba6d88f..3240cbb779c6 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultSurfaceAnimator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/DefaultSurfaceAnimator.java @@ -169,7 +169,7 @@ public class DefaultSurfaceAnimator { needCrop = true; } if (needCrop) { - t.setCrop(leash, mAnimClipRect); + t.setWindowCrop(leash, mAnimClipRect); } } } -- cgit v1.2.3-59-g8ed1b