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
This commit is contained in:
Garfield Tan
2022-06-15 15:43:37 -07:00
parent 5efb142e0d
commit 926a76243d

View File

@@ -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) {