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

Commit db650d49 authored by wilsonshih's avatar wilsonshih
Browse files

Notify exit animation done to transfered starting window.

The starting window could transfer to another activity after app
transition started, in that case the latest top activity might not
receive exit animation done callback if there is no animation applied
to the starting window. Here we can notify animation finish to the
starting window if it is waiting for mAnimatingExit.

Bug: 184915086
Test: manual test on developer's app
Change-Id: I7666f0290d8aea8a8a3a5a6ad1856d25d54d4983
parent cf150a40
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -6670,6 +6670,19 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // traverse the copy.
        final ArrayList<WindowState> children = new ArrayList<>(mChildren);
        children.forEach(WindowState::onExitAnimationDone);
        // The starting window could transfer to another activity after app transition started, in
        // that case the latest top activity might not receive exit animation done callback if the
        // starting window didn't applied exit animation success. Notify animation finish to the
        // starting window if needed.
        if (task != null && startingMoved) {
            final WindowState transferredStarting = task.getWindow(w ->
                    w.mAttrs.type == TYPE_APPLICATION_STARTING);
            if (transferredStarting != null && transferredStarting.mAnimatingExit
                    && !transferredStarting.isSelfAnimating(0 /* flags */,
                    ANIMATION_TYPE_WINDOW_ANIMATION)) {
                transferredStarting.onExitAnimationDone();
            }
        }

        getDisplayContent().mAppTransition.notifyAppTransitionFinishedLocked(token);
        scheduleAnimation();