From 926a76243d290596c176dbf6f643130cb3cbf6cd Mon Sep 17 00:00:00 2001 From: Garfield Tan Date: Wed, 15 Jun 2022 15:43:37 -0700 Subject: [PATCH] Avoid using starting bounds of open transitions Starting bounds are undefined in open transitions. Bug: 235496520 Test: Animation leash isn't put at the origin of the screen display for non-fullscreen tasks. Change-Id: I4913daeead5471f82086d41eac61600b342d02a0 --- .../systemui/shared/system/RemoteAnimationTargetCompat.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java index 4ce110bf7c471..249133a9a63bd 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RemoteAnimationTargetCompat.java @@ -141,8 +141,10 @@ public class RemoteAnimationTargetCompat { final int mode = change.getMode(); t.reparent(leash, info.getRootLeash()); - t.setPosition(leash, change.getStartAbsBounds().left - info.getRootOffset().x, - change.getStartAbsBounds().top - info.getRootOffset().y); + final Rect absBounds = + (mode == TRANSIT_OPEN) ? change.getEndAbsBounds() : change.getStartAbsBounds(); + t.setPosition(leash, absBounds.left - info.getRootOffset().x, + absBounds.top - info.getRootOffset().y); // Put all the OPEN/SHOW on top if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {