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

Commit 35c93e8d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix unexpected surface visible after closing animation" into sc-v2-dev am: 38b65a15

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16081870

Change-Id: I4bfa861a7db6f6b7c40d6a4b17824479f4921929
parents a8ff7f17 38b65a15
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) {