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

Commit 49041bfc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add more logs in WindowManagerService#waitForAnimationsToComplete" into...

Merge "Add more logs in WindowManagerService#waitForAnimationsToComplete" into sc-dev am: dacdc6a7

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

Change-Id: I5401ff72533786985de9f6eb6d45a929d064e34b
parents c7a8d0d8 dacdc6a7
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -520,7 +520,7 @@ class SurfaceAnimator {
    /**
    /**
     * Converts {@link AnimationType} to String.
     * Converts {@link AnimationType} to String.
     */
     */
    private static String animationTypeToString(@AnimationType int type) {
    static String animationTypeToString(@AnimationType int type) {
        switch (type) {
        switch (type) {
            case ANIMATION_TYPE_NONE: return "none";
            case ANIMATION_TYPE_NONE: return "none";
            case ANIMATION_TYPE_APP_TRANSITION: return "app_transition";
            case ANIMATION_TYPE_APP_TRANSITION: return "app_transition";
+15 −5
Original line number Original line Diff line number Diff line
@@ -106,6 +106,7 @@ import static com.android.server.wm.ActivityTaskManagerService.POWER_MODE_REASON
import static com.android.server.wm.DisplayContent.IME_TARGET_CONTROL;
import static com.android.server.wm.DisplayContent.IME_TARGET_CONTROL;
import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_ALL;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
@@ -8090,8 +8091,13 @@ public class WindowManagerService extends IWindowManager.Stub
            // This could prevent if there is no container animation, we still have to apply the
            // This could prevent if there is no container animation, we still have to apply the
            // pending transaction and exit waiting.
            // pending transaction and exit waiting.
            mAnimator.mNotifyWhenNoAnimation = true;
            mAnimator.mNotifyWhenNoAnimation = true;
            while ((mAnimator.isAnimationScheduled()
            WindowContainer animatingContainer = null;
                    || mRoot.isAnimating(TRANSITION | CHILDREN)) && timeoutRemaining > 0) {
            while (mAnimator.isAnimationScheduled() || timeoutRemaining > 0) {
                animatingContainer = mRoot.getAnimatingContainer(TRANSITION | CHILDREN,
                        ANIMATION_TYPE_ALL);
                if (animatingContainer == null) {
                    break;
                }
                long startTime = System.currentTimeMillis();
                long startTime = System.currentTimeMillis();
                try {
                try {
                    mGlobalLock.wait(timeoutRemaining);
                    mGlobalLock.wait(timeoutRemaining);
@@ -8101,9 +8107,13 @@ public class WindowManagerService extends IWindowManager.Stub
            }
            }
            mAnimator.mNotifyWhenNoAnimation = false;
            mAnimator.mNotifyWhenNoAnimation = false;


            if (mAnimator.isAnimationScheduled()
            if (mAnimator.isAnimationScheduled() || animatingContainer != null) {
                    || mRoot.isAnimating(TRANSITION | CHILDREN)) {
                Slog.w(TAG, "Timed out waiting for animations to complete,"
                Slog.w(TAG, "Timed out waiting for animations to complete.");
                        + " animatingContainer=" + animatingContainer
                        + " animationType=" + SurfaceAnimator.animationTypeToString(
                        animatingContainer != null
                                ? animatingContainer.mSurfaceAnimator.getAnimationType()
                                : SurfaceAnimator.ANIMATION_TYPE_NONE));
            }
            }
        }
        }
    }
    }