WindowManagerPolicy#TRANSIT_ENTER Animation

com.android.server.wm.WindowState#performShowLocked()
com.android.server.wm.WindowStateAnimator#applyEnterAnimationLocked()
com.android.server.wm.WindowStateAnimator#applyAnimationLocked()
com.android.server.wm.WindowState#startAnimation()

com.android.server.wm.WindowStateAnimator#applyAnimationLocked():

    /**
     * Choose the correct animation and set it to the passed WindowState.
     * @param transit If AppTransition.TRANSIT_PREVIEW_DONE and the app window has been drawn
     *      then the animation will be app_starting_exit. Any other value loads the animation from
     *      the switch statement below.
     * @param isEntrance The animation type the last time this was called. Used to keep from
     *      loading the same animation twice.
     * @return true if an animation has been loaded.
     */
    boolean applyAnimationLocked(int transit, boolean isEntrance) {
        if (mWin.isAnimating() && mAnimationIsEntrance == isEntrance) {
            // If we are trying to apply an animation, but already running
            // an animation of the same type, then just leave that one alone.
            return true;
        }

        if (mWin.mAttrs.type == TYPE_INPUT_METHOD) {
            mWin.getDisplayContent().adjustForImeIfNeeded();
            if (isEntrance) {
                mWin.setDisplayLayoutNeeded();
                mService.mWindowPlacerLocked.requestTraversal(22);
            }
        }

        if (mWin.mControllableInsetProvider != null) {
            // All our animations should be driven by the insets control target.
            return false;
        }

        // Only apply an animation if the display isn't frozen.  If it is
        // frozen, there is no reason to animate and it can cause strange
        // artifacts when we unfreeze the display if some different animation
        // is running.
        if (mWin.mToken.okToAnimate()) {
            int anim = mWin.getDisplayContent().getDisplayPolicy().selectAnimation(mWin, transit);
            int attr = -1;
            Animation a = null;
            if (anim != DisplayPolicy.ANIMATION_STYLEABLE) {
                if (anim != DisplayPolicy.ANIMATION_NONE) {
                    Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "WSA#loadAnimation");
                    a = AnimationUtils.loadAnimation(mContext, anim);
                    Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
                }
            } else {
                switch (transit) {
                    case WindowManagerPolicy.TRANSIT_ENTER:
                        if(1==1)  throw new RuntimeException("WindowManagerPolicy.TRANSIT_ENTER,isEntrance:"+isEntrance);
                        attr = com.android.internal.R.styleable.WindowAnimation_windowEnterAnimation;
                        break;
                    case WindowManagerPolicy.TRANSIT_EXIT:
//                        if(1==1)  throw new RuntimeException("WindowManagerPolicy.TRANSIT_EXIT,isEntrance:"+isEntrance);
                        attr = com.android.internal.R.styleable.WindowAnimation_windowExitAnimation;
                        break;
                    case WindowManagerPolicy.TRANSIT_SHOW:
//                        if(1==1)  throw new RuntimeException("WindowManagerPolicy.TRANSIT_SHOW,isEntrance:"+isEntrance);
                        attr = com.android.internal.R.styleable.WindowAnimation_windowShowAnimation;
                        break;
                    case WindowManagerPolicy.TRANSIT_HIDE:
//                        if(1==1)  throw new RuntimeException("WindowManagerPolicy.TRANSIT_HIDE,isEntrance:"+isEntrance);
                        attr = com.android.internal.R.styleable.WindowAnimation_windowHideAnimation;
                        break;
                }
                if (attr >= 0) {
                    a = mWin.getDisplayContent().mAppTransition.loadAnimationAttr(
                            mWin.mAttrs, attr, TRANSIT_OLD_NONE);
                }
            }
            if (ProtoLogImpl.isEnabled(WM_DEBUG_ANIM)) {
                ProtoLog.v(WM_DEBUG_ANIM, "applyAnimation: win=%s"
                        + " anim=%d attr=0x%x a=%s transit=%d type=%d isEntrance=%b Callers %s",
                        this, anim, attr, a, transit, mAttrType, isEntrance, Debug.getCallers(20));
            }
            if (a != null) {
                Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "WSA#startAnimation");
                mWin.startAnimation(a);
                Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER);
                mAnimationIsEntrance = isEntrance;
            }
        } else {
            mWin.cancelAnimation();
        }

        return mWin.isAnimating(0 /* flags */, ANIMATION_TYPE_WINDOW_ANIMATION);
    }

java.lang.RuntimeException: WindowManagerPolicy.TRANSIT_ENTER,isEntrance:true
        	at com.android.server.wm.WindowStateAnimator.applyAnimationLocked(WindowStateAnimator.java:618)
        	at com.android.server.wm.WindowStateAnimator.applyEnterAnimationLocked(WindowStateAnimator.java:564)
        	at com.android.server.wm.WindowState.performShowLocked(WindowState.java:4694)
        	at com.android.server.wm.ActivityRecord.lambda$showAllWindowsLocked$17(ActivityRecord.java:6768)
        	at com.android.server.wm.ActivityRecord.$r8$lambda$EBjQ9_0_gnlxfoGHjA_CqMEFYX8(Unknown Source:0)
        	at com.android.server.wm.ActivityRecord$$ExternalSyntheticLambda36.accept(Unknown Source:2)
        	at com.android.server.wm.WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowContainer.java:2729)
        	at com.android.server.wm.WindowContainer$ForAllWindowsConsumerWrapper.apply(WindowContainer.java:2719)
        	at com.android.server.wm.WindowState.applyInOrderWithImeWindows(WindowState.java:4953)
        	at com.android.server.wm.WindowState.forAllWindows(WindowState.java:4793)
        	at com.android.server.wm.WindowContainer.forAllWindows(WindowContainer.java:1707)
        	at com.android.server.wm.WindowContainer.forAllWindows(WindowContainer.java:1717)
        	at com.android.server.wm.ActivityRecord.showAllWindowsLocked(ActivityRecord.java:6766)
        	at com.android.server.wm.AppTransitionController.handleOpeningApps(AppTransitionController.java:1176)
        	at com.android.server.wm.AppTransitionController.handleAppTransitionReady(AppTransitionController.java:305)
        	at com.android.server.wm.RootWindowContainer.checkAppTransitionReady(RootWindowContainer.java:971)
        	at com.android.server.wm.RootWindowContainer.performSurfacePlacementNoTrace(RootWindowContainer.java:835)
        	at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:778)
        	at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:178)
        	at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:127)
        	at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:116)
        	at com.android.server.wm.WindowSurfacePlacer$Traverser.run(WindowSurfacePlacer.java:58)
        	at android.os.Handler.handleCallback(Handler.java:942)
        	at android.os.Handler.dispatchMessage(Handler.java:99)
        	at android.os.Looper.loopOnce(Looper.java:201)
        	at android.os.Looper.loop(Looper.java:288)
        	at android.os.HandlerThread.run(HandlerThread.java:67)
        	at com.android.server.ServiceThread.run(ServiceThread.java:44)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值