Activity切换 窗口绘制显示

08-29 18:12:26.910 I/ActivityManager( 1587): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 pkg=com.dangbeimarket cmp=com.dangbeimarket/.activity.WelcomeActivity} from pid 2225
08-29 18:12:26.920 D/ActivityManager( 1587): Looking for task of ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t-1}
08-29 18:12:26.920 D/ActivityManager( 1587): Looking for task of ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t-1} in ActivityStack{423ca958 stackId=0, 1 tasks}

08-29 18:12:26.925 V/ActivityManager( 1587): Starting new activity ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t3} in new task TaskRecord{42939110 #3 A=com.dangbeimarket U=0 sz=0}
08-29 18:12:26.945 D/SurfaceFlinger( 1158): captureScreen: opTimingWidth = 1280, opTimingHeight = 720, maxLayerZ = 21010
08-29 18:12:26.955 V/WindowManager( 1587): Adding window Window{42819a20 u0 Starting com.dangbeimarket} at 3 of 5 (after Window{428e3a68 u0 com.android.launcher/.AppActivity})
08-29 18:12:26.960 I/AppActivity( 2225): onPause
08-29 18:12:26.960 D/launcher( 2225): onPause()
08-29 18:12:26.960 V/WindowStateAnimator( 1587): Creating surface in session android.view.SurfaceSession@4233f330 window WindowStateAnimator{428b4520 Starting com.dangbeimarket} w=0 h=0 format=-1 flags=4

08-29 18:12:26.980 E/WindowManager( 1587):     at com.android.server.wm.AppWindowToken.updateReportedVisibilityLocked(AppWindowToken.java:139)
08-29 18:12:26.980 E/WindowManager( 1587):     at com.android.server.wm.WindowManagerService.relayoutWindow(WindowManagerService.java:3028)
08-29 18:12:26.980 E/WindowManager( 1587):     at com.android.server.wm.Session.relayout(Session.java:190)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.view.ViewRootImpl.relayoutWindow(ViewRootImpl.java:5079)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1410)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:996)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5600)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.view.Choreographer.doCallbacks(Choreographer.java:574)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.view.Choreographer.doFrame(Choreographer.java:544)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.os.Handler.handleCallback(Handler.java:733)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.os.Handler.dispatchMessage(Handler.java:95)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.os.Looper.loop(Looper.java:136)
08-29 18:12:26.980 E/WindowManager( 1587):     at android.os.HandlerThread.run(HandlerThread.java:61)

08-29 18:12:26.980 V/WindowManager( 1587): Update reported visibility: AppWindowToken{428cb600 token=Token{42802438 ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t3}}}
08-29 18:12:26.980 V/WindowManager( 1587): VIS AppWindowToken{428cb600 token=Token{42802438 ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t3}}}: interesting=0 visible=0

08-29 18:12:27.025 V/WindowManager( 1587): setAppVisibility(Token{42802438 ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t3}}, visible=true): mNextAppTransition=0x1008 hidden=true hiddenRequested=true
08-29 18:12:27.025 V/WindowManager( 1587): Setting dummy animation on: AppWindowToken{428cb600 token=Token{42802438 ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t3}}}
08-29 18:12:27.025 V/WindowManager( 1587): setAppVisibility(Token{4293daa8 ActivityRecord{42938ac8 u0 com.android.launcher/.AppActivity t2}}, visible=false): mNextAppTransition=0x1008 hidden=false hiddenRequested=false
08-29 18:12:27.025 V/WindowManager( 1587): Setting dummy animation on: AppWindowToken{42924d08 token=Token{4293daa8 ActivityRecord{42938ac8 u0 com.android.launcher/.AppActivity t2}}}
08-29 18:12:27.030 V/WindowManager( 1587): Eval win Window{42819a20 u0 Starting com.dangbeimarket}: isDrawn=true, isAnimating=true

08-29 18:12:27.045 W/WindowManager( 1587): Execute app transition: mNextAppTransition=0x1008
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.wm.AppWindowToken.updateReportedVisibilityLocked(AppWindowToken.java:139)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.wm.WindowManagerService.handleAppTransitionReadyLocked(WindowManagerService.java:8672)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedInner(WindowManagerService.java:9303)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLockedLoop(WindowManagerService.java:8273)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.wm.WindowManagerService.performLayoutAndPlaceSurfacesLocked(WindowManagerService.java:8215)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.wm.WindowManagerService.executeAppTransition(WindowManagerService.java:3950)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityStackSupervisor.reportResumedActivityLocked(ActivityStackSupervisor.java:2362)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityStack.completeResumeLocked(ActivityStack.java:1001)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityStack.minimalResumeActivityLocked(ActivityStack.java:617)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityStackSupervisor.realStartActivityLocked(ActivityStackSupervisor.java:1079)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked(ActivityStackSupervisor.java:1120)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1694)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityStackSupervisor.resumeTopActivitiesLocked(ActivityStackSupervisor.java:2096)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityStack.completePauseLocked(ActivityStack.java:944)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityStack.activityPausedLocked(ActivityStack.java:849)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityManagerService.activityPaused(ActivityManagerService.java:5293)
08-29 18:12:27.080 E/WindowManager( 1587):     at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java:426)
08-29 18:12:27.080 E/WindowManager( 1587):     at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2108)
08-29 18:12:27.080 E/WindowManager( 1587):     at android.os.Binder.execTransact(Binder.java:404)
08-29 18:12:27.080 E/WindowManager( 1587):     at dalvik.system.NativeStart.run(Native Method)

08-29 18:12:27.080 V/AppWindowAnimator( 1587): performing show on: WindowStateAnimator{428b4520 Starting com.dangbeimarket}
g=true tok animating=false
08-29 18:12:27.080 V/WindowStateAnimator( 1587): Showing WindowStateAnimator{428b4520 Starting com.dangbeimarket} during animation: policyVis=true attHidden=false tok.hiddenRequested=false tok.hidden=false animating=true tok animating=false

08-29 18:12:27.095 V/WindowStateAnimator( 1587): Showing Window{42819a20 u0 Starting com.dangbeimarket} during relayout

08-29 18:12:27.170 V/WindowManager( 1587): Adding window Window{42358f98 u0 com.dangbeimarket/com.dangbeimarket.activity.WelcomeActivity} at 3 of 6 (before Window{42819a20 u0 Starting com.dangbeimarket})
se animating=false tok animating=false

08-29 18:12:27.440 V/WindowManager( 1587): Eval win Window{42819a20 u0 Starting com.dangbeimarket}: isDrawn=true, isAnimating=true
08-29 18:12:27.440 V/WindowManager( 1587): Eval win Window{42358f98 u0 com.dangbeimarket/com.dangbeimarket.activity.WelcomeActivity}: isDrawn=false, isAnimating=true
08-29 18:12:27.440 V/WindowManager( 1587): Not displayed: s=Surface(name=com.dangbeimarket/com.dangbeimarket.activity.WelcomeActivity) pv=true mDrawState=1 ah=false th=false a=true
08-29 18:12:27.445 W/WindowStateAnimator( 1587): Window WindowStateAnimator{428e4100 com.android.launcher/.AppActivity} destroying surface Surface(name=com.android.launcher/.AppActivity), session Session{42992778 2225:u0a10015}
08-29 18:12:27.445 W/WindowStateAnimator( 1587): Window WindowStateAnimator{42a60908 SurfaceView} destroying surface Surface(name=SurfaceView), session Session{42992778 2225:u0a10015}
se animating=false tok animating=false
08-29 18:12:27.505 V/WindowManager( 1587): Eval win Window{42819a20 u0 Starting com.dangbeimarket}: isDrawn=true, isAnimating=true
08-29 18:12:27.505 V/WindowManager( 1587): Eval win Window{42358f98 u0 com.dangbeimarket/com.dangbeimarket.activity.WelcomeActivity}: isDrawn=true, isAnimating=true
08-29 18:12:27.505 V/WindowManager( 1587): tokenMayBeDrawn: AppWindowToken{428cb600 token=Token{42802438 ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t3}}} freezingScreen=false mAppFreezing=false
08-29 18:12:27.505 V/WindowManager( 1587): allDrawn: AppWindowToken{428cb600 token=Token{42802438 ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t3}}} interesting=1 drawn=1

08-29 18:12:27.520 E/WindowManager( 1587):     at com.android.server.wm.AppWindowToken.updateReportedVisibilityLocked(AppWindowToken.java:139)
08-29 18:12:27.520 E/WindowManager( 1587):     at com.android.server.wm.WindowStateAnimator.performShowLocked(WindowStateAnimator.java:1480)
08-29 18:12:27.520 E/WindowManager( 1587):     at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:311)
08-29 18:12:27.520 E/WindowManager( 1587):     at com.android.server.wm.WindowAnimator.performAnimationsLocked(WindowAnimator.java:453)
08-29 18:12:27.520 E/WindowManager( 1587):     at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:497)
08-29 18:12:27.520 E/WindowManager( 1587):     at com.android.server.wm.WindowAnimator.access$000(WindowAnimator.java:36)
08-29 18:12:27.520 E/WindowManager( 1587):     at com.android.server.wm.WindowAnimator$1.run(WindowAnimator.java:98)
08-29 18:12:27.520 E/WindowManager( 1587):     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
08-29 18:12:27.520 E/WindowManager( 1587):     at android.view.Choreographer.doCallbacks(Choreographer.java:574)
08-29 18:12:27.520 E/WindowManager( 1587):     at android.view.Choreographer.doFrame(Choreographer.java:543)
08-29 18:12:27.520 E/WindowManager( 1587):     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
08-29 18:12:27.520 E/WindowManager( 1587):     at android.os.Handler.handleCallback(Handler.java:733)
08-29 18:12:27.520 E/WindowManager( 1587):     at android.os.Handler.dispatchMessage(Handler.java:95)
08-29 18:12:27.520 E/WindowManager( 1587):     at android.os.Looper.loop(Looper.java:136)
08-29 18:12:27.520 E/WindowManager( 1587):     at android.os.HandlerThread.run(HandlerThread.java:61)

08-29 18:12:27.520 V/WindowStateAnimator( 1587): Showing Window{42358f98 u0 com.dangbeimarket/com.dangbeimarket.activity.WelcomeActivity} during relayout
08-29 18:12:27.520 V/AppWindowAnimator( 1587): performing show on: WindowStateAnimator{428b4520 Starting com.dangbeimarket}
g=true tok animating=true
08-29 18:12:27.525 I/ActivityManager( 1587): Displayed com.dangbeimarket/.activity.WelcomeActivity: +501ms
08-29 18:12:27.525 V/WindowManager( 1587): Reporting drawn in AppWindowToken{428cb600 token=Token{42802438 ActivityRecord{428590c0 u0 com.dangbeimarket/.activity.WelcomeActivity t3}}}

mHomeStack
mFocusedStack

ActivityStackSupervisor.java
    startActivityLocked
    Slog.i(TAG, "START u" + userId + " {" + intent.toShortString(true, true, true, false)+ "} from pid " + (callerApp != null ? callerApp.pid : callingPid));
        startActivityUncheckedLocked
            findTaskLocked//查找当前task是否有该activity
            //有的话就恢复到前台顶端
            resumeTopActivitiesLocked(targetStack, null, options);
            //没有的话就创建一个新的task
            if (DEBUG_TASKS) Slog.v(TAG, "Starting new activity " + r + " in new task " +
                        r.task);
            targetStack.startActivityLocked(r, newTask, doResume, keepCurTransition, options);
    
    findTaskLocked
        if (DEBUG_TASKS) Slog.d(TAG, "Looking for task of " + r);
        stack.findTaskLocked(r);
ActivityStack.java
    findTaskLocked
        if (DEBUG_TASKS) Slog.d(TAG, "Looking for task of " + target + " in " + this);
        if (DEBUG_TASKS) Slog.d(TAG, "Skipping " + task + ": mismatch root " + r);
        
    startActivityLocked    
        mWindowManager.addAppToken(task.mActivities.indexOf(r), r.appToken,r.task.taskId, mStackId, r.info.screenOrientation, r.fullscreen,(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0, r.userId,r.info.configChanges);
        
WindowManagerService.java        
    addAppToken
        if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + atoken
                    + " to stack=" + stackId + " task=" + taskId + " at " + addPos);
        mTokenMap.put(token.asBinder(), atoken);

WindowManagerImpl.java    
    mGlobal.addView
        
WindowManagerGlobal.java
    addView
        root.setView
        
ViewRootImpl.java
    setView
        addToDisplay
        
    cheduleTraversals
        doTraversal        
            performTraversals
                relayoutWindow
                    mWindowSession.relayout
        
Session.java
    addToDisplay
        mService.addWindow
            WindowToken token = mTokenMap.get(attrs.token);
            win = new WindowState(this, session, client, token,
                    attachedWindow, appOp[0], seq, attrs, viewVisibility, displayContent);
            res = mPolicy.prepareAddWindowLw(win, attrs);
            mInputManager.registerInputChannel(win.mInputChannel, win.mInputWindowHandle);
            
            addWindowToListInOrderLocked(win, true);
                placeWindowAfter
                    if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(
                        TAG, "Adding window " + window + " at "
                        + (i+1) + " of " + windows.size() + " (after " + pos + ")");
                        
                    windows.add(i+1, window);
                    mWindowsChanged = true;

            if (win.canReceiveKeys()) {
                focusChanged = updateFocusedWindowLocked(UPDATE_FOCUS_WILL_ASSIGN_LAYERS,
                        false /*updateInputWindows*/);
                if (focusChanged) {
                    imMayMove = false;
                }
            }
            if (imMayMove) {
                moveInputMethodWindowsIfNeededLocked(false);
            }
            //合成layers。各个Window
            assignLayersLocked(displayContent.getWindowList());
            // Don't do layout here, the window must call
            // relayout to be displayed, so we'll do it there.
    
    relayout    
        mService.relayoutWindow(this, window, seq, attrs,
                requestedWidth, requestedHeight, viewFlags, flags,
                outFrame, outOverscanInsets, outContentInsets, outVisibleInsets,
                outConfig, outSurface);    
                
WindowManagerService.java                
    relayoutWindow
        SurfaceControl surfaceControl = winAnimator.createSurfaceLocked();
        win.mAppToken.updateReportedVisibilityLocked();
        performLayoutAndPlaceSurfacesLocked
        
WindowStateAnimator.java        
    createSurfaceLocked

AppWindowToken.java    
    updateReportedVisibilityLocked    
        if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG,
                    "Update reported visibility: " + this);
        if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "VIS " + this + ": interesting="
                    + numInteresting + " visible=" + numVisible);    
                            
WindowManagerService.java                                
performLayoutAndPlaceSurfacesLocked
    performLayoutAndPlaceSurfacesLockedInner        
    if (DEBUG_VISIBILITY || DEBUG_ORIENTATION) {
                                        Slog.v(TAG, "Eval win " + w + ": isDrawn=" + w.isDrawnLw()
                                                + ", isAnimating=" + winAnimator.isAnimating());
                                                
Activity.java
    onPause                                                
ActivityStack.java
    resumeTopActivityLocked                    
        mWindowManager.setAppVisibility(prev.appToken, false);
        mWindowManager.setAppVisibility(next.appToken, true);    
        mStackSupervisor.startSpecificActivityLocked(next, true, true);
        
WindowManagerService.java        
    setAppVisibility    
        Slog.v(TAG, "setAppVisibility(" + token + ", visible=" + visible
                        + "): " + mAppTransition
                        + " hidden=" + wtoken.hidden
                        + " hiddenRequested=" + wtoken.hiddenRequested, e);
        if (DEBUG_APP_TRANSITIONS) Slog.v(
                            TAG, "Setting dummy animation on: " + wtoken);

ActivityStackSupervisor.java
    startSpecificActivityLocked
        reportResumedActivityLocked
        
        executeAppTransition
        performLayoutAndPlaceSurfacesLockedInner
            Slog.v(TAG, "Eval win " + w + ": isDrawn=" + w.isDrawnLw()
                                            + ", isAnimating=" + winAnimator.isAnimating());
            handleAppTransitionReadyLocked
        handleAppTransitionReadyLocked
            AppWindowToken wtoken = mOpeningApps.get(i);
            final AppWindowAnimator appAnimator = wtoken.mAppAnimator;
            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now opening app" + wtoken);            
            setTokenVisibilityLocked
                if (DEBUG_APP_TRANSITIONS) Slog.v(
                TAG, "Changing app " + wtoken + " hidden=" + wtoken.hidden
                + " performLayout=" + performLayout);
                applyAnimationLocked
            wtoken.updateReportedVisibilityLocked();
            appAnimator.showAllWindowsLocked();
                mService.scheduleAnimationLocked();
                    animateLocked
                        windows.get(j).mWinAnimator.prepareSurfaceLocked(true);
                            if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(TAG, "Showing " + w
                                + " during relayout");
            
            AppWindowToken wtoken = mClosingApps.get(i);
            if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Now closing app " + wtoken);
            setTokenVisibilityLocked(wtoken, animLp, false, transit, false);
                if (DEBUG_APP_TRANSITIONS) Slog.v(
                TAG, "Changing app " + wtoken + " hidden=" + wtoken.hidden
                + " performLayout=" + performLayout);
                applyAnimationLocked
            wtoken.updateReportedVisibilityLocked();

AppWindowToken.java    
    updateReportedVisibilityLocked    
        if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG,
                    "Update reported visibility: " + this);
        if (WindowManagerService.DEBUG_VISIBILITY) Slog.v(WindowManagerService.TAG, "VIS " + this + ": interesting="
                    + numInteresting + " visible=" + numVisible);

placeWindowBefore


总结:
window 窗口绘制:performLayoutAndPlaceSurfacesLockedInner
window 窗口可见性改变检查:updateReportedVisibilityLocked

                    

你可能感兴趣的:(Android,显示系统,Android,UI)