Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c84579ea authored by wilsonshih's avatar wilsonshih
Browse files

[PB] Fix typo when migrate PB to shell transition.

...which could cause out-of-index error.
And only continuing merge the transition info from prepare_open if
the second transition info has close target. Otherwise this should
be close_prepare transition and it can be consumed directly.

Flag: com.android.window.flags.migrate_predictive_back_transition
Bug: 358422448
Test: atest BackAnimationControllerTest
Change-Id: I8795b2dd40e2c2928be6e68fbd1d2ea47d1ff5a1
parent 2b8a44d8
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -1313,7 +1313,9 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
                        info.getChanges().remove(j);
                    }
                }
                tmpSize = info.getChanges().size();
                // Ignore merge if there is no close target
                if (!info.getChanges().isEmpty()) {
                    tmpSize = init.getChanges().size();
                    for (int i = 0; i < tmpSize; ++i) {
                        final TransitionInfo.Change change = init.getChanges().get(i);
                        if (moveToTop) {
@@ -1323,6 +1325,7 @@ public class BackAnimationController implements RemoteCallable<BackAnimationCont
                        }
                        info.getChanges().add(i, change);
                    }
                }
            } else {
                // Open transition, the transition info should be:
                // init info(open A & wallpaper)