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

Commit 38b65a15 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix unexpected surface visible after closing animation" into sc-v2-dev

parents e0629d36 bf6b4287
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4961,7 +4961,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
     */
    private void postApplyAnimation(boolean visible, boolean fromTransition) {
        final boolean usingShellTransitions = mTransitionController.isShellTransitionsEnabled();
        final boolean delayed = isAnimating(TRANSITION | PARENTS | CHILDREN,
        final boolean delayed = isAnimating(PARENTS | CHILDREN,
                ANIMATION_TYPE_APP_TRANSITION | ANIMATION_TYPE_WINDOW_ANIMATION
                        | ANIMATION_TYPE_RECENTS);
        if (!delayed && !usingShellTransitions) {
+5 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ import static com.android.server.wm.ActivityRecord.State.RESUMED;
import static com.android.server.wm.ActivityRecord.State.STARTED;
import static com.android.server.wm.ActivityRecord.State.STOPPED;
import static com.android.server.wm.ActivityRecord.State.STOPPING;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.TaskFragment.TASK_FRAGMENT_VISIBILITY_INVISIBLE;
import static com.android.server.wm.TaskFragment.TASK_FRAGMENT_VISIBILITY_VISIBLE;
import static com.android.server.wm.TaskFragment.TASK_FRAGMENT_VISIBILITY_VISIBLE_BEHIND_TRANSLUCENT;
@@ -3026,6 +3027,10 @@ public class ActivityRecordTests extends WindowTestsBase {

        // Because the app is waiting for transition, it should not hide the surface.
        assertTrue(app.mActivityRecord.isSurfaceShowing());

        // Ensure onAnimationFinished will callback when the closing animation is finished.
        verify(app.mActivityRecord).onAnimationFinished(eq(ANIMATION_TYPE_APP_TRANSITION),
                eq(null));
    }

    private void assertHasStartingWindow(ActivityRecord atoken) {