FrameW

对比1:出bug情况

先hite 然后再 show,产生黑屏
01-01 14:45:48.121 2143 2425 V SurfaceControl: SurfaceControl hide: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 14:45:48.123 2143 2425 V SurfaceControl: SurfaceControl show : Surface(name=SnapshotStartingWindow for taskId=7)
01-01 14:45:48.123 2143 2425 I DetectBlack: Resume from black! showSurface surface:Surface(name=SnapshotStartingWindow for taskId=7)
01-01 14:45:48.390 2143 2425 I DetectBlack: No surface, maybe black! with hideSurface() surface:Surface(name=SnapshotStartingWindow for taskId=7)
01-01 14:45:48.390 2143 2425 V SurfaceControl: SurfaceControl hide: Surface(name=SnapshotStartingWindow for taskId=7)
01-01 14:45:48.390 2143 2425 V SurfaceControl: SurfaceControl hide: Surface(name=VColorFullScreenDisplay)
01-01 14:45:49.177 2143 2425 V SurfaceControl: SurfaceControl show : Surface(name=com.android.browser/com.opera.android.BrowserActivity)
01-01 14:45:49.178 2143 2425 I DetectBlack: Resume from black! showSurface surface:Surface(name=com.android.browser/com.opera.android.BrowserActivity)
01-01 14:45:49.178 2143 2425 V SurfaceControl: SurfaceControl show : Surface(name=SnapshotStartingWindow for taskId=7)
01-01 14:45:49.183 2143 2425 V SurfaceControl: SurfaceControl hide: Surface(name=SnapshotStartingWindow for taskId=7)
01-01 14:45:49.183 2143 2425 V SurfaceControl: SurfaceControl destroy: Surface(name=SnapshotStartingWindow for taskId=7)
01-01 14:45:49.506 2143 2425 V SurfaceControl: SurfaceControl show : Surface(name=InputMethod)
01-01 14:45:49.588 2143 4481 V SurfaceControl: SurfaceControl destroy: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)

黑屏时hide的流程


FrameW_第1张图片
image.png

对比2:桌面正常跳转hide情况

桌面正常调整hide的流程,在退出动画结束时hide


FrameW_第2张图片
image.png

对比3:概率性不黑屏时的情况

概率性的,不黑屏时的情况,com.example.bookmark.MainActivity是最后才hide的
01-01 15:06:09.273 2143 2425 V SurfaceControl: SurfaceControl show : Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 15:07:57.639 2143 2425 V SurfaceControl: SurfaceControl hide: Surface(name=com.oppo.launcher/com.oppo.launcher.Launcher)
01-01 15:07:59.225 2143 2425 V SurfaceControl: SurfaceControl hide: Surface(name=com.android.systemui.ImageWallpaper)
01-01 15:07:59.789 2143 5091 V SurfaceControl: SurfaceControl destroy: Surface(name=com.oppo.launcher/com.oppo.launcher.Launcher)
01-01 15:07:59.980 2143 2425 V SurfaceControl: SurfaceControl show : Surface(name=VColorFullScreenDisplay)
01-01 15:08:13.141 2143 2232 V SurfaceControl: SurfaceControl destroy: Surface(name=SnapshotStartingWindow for taskId=7)
01-01 15:08:15.730 2143 2425 V SurfaceControl: SurfaceControl show : Surface(name=com.android.browser/com.opera.android.BrowserActivity)
01-01 15:09:05.460 2143 2425 V SurfaceControl: SurfaceControl hide: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
也是在动画结束时才hide


FrameW_第3张图片
image.png

加log搞

加log的情况,说明在WindowState中函数isonsreen中返回false导致的。
01-01 16:54:23.267 16535 18524 D wenfeng : atoken != null return true
01-01 16:54:23.274 16535 16644 D wenfeng : atoken != null return true
01-01 16:54:23.281 16535 16644 D wenfeng : atoken != null return true
01-01 16:54:23.321 16535 16644 D wenfeng : atoken != null return true
01-01 16:54:23.347 16535 16644 D wenfeng : atoken != null return true
01-01 16:54:23.449 16535 16644 D wenfeng : atoken != null return false
01-01 16:54:23.449 16535 16644 D wenfeng : begin hide fuck
01-01 16:54:23.450 16535 16644 I DetectBlack: No surface, maybe black! with hideSurface() surface:Surface(name=com.example.bookmark/com.example.bookmark.Maivity)
01-01 16:54:23.450 16535 16644 V SurfaceControl: SurfaceControl hide: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 16:54:23.451 16535 16644 V SurfaceControl: SurfaceControl show : Surface(name=SnapshotStartingWindow for taskId=12)
01-01 16:54:23.454 16535 16644 I DetectBlack: Resume from black! showSurface surface:Surface(name=SnapshotStartingWindow for taskId=12)
01-01 16:54:23.532 16535 16644 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 16:54:23.532 16535 16644 D wenfeng : begin hide fuck
01-01 16:54:23.621 16535 16644 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 16:54:23.622 16535 16644 D wenfeng : begin hide fuck

加log后,不复现的情况,可以看到一直返回是true
01-01 17:05:40.783 22570 23856 D wenfeng : atoken != null return true
01-01 17:05:40.798 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:40.838 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:40.865 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:40.933 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:40.949 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:40.966 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.001 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.028 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.033 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.056 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.072 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.152 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.168 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.186 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.203 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.219 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.235 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.267 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.273 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.286 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.321 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.404 22570 22609 V SurfaceControl: SurfaceControl destroy: Surface(name=SnapshotStartingWindow for taskId=16)
01-01 17:05:41.406 22570 22609 D wenfeng : atoken != null return true
01-01 17:05:41.422 22570 22662 D wenfeng : atoken != null return true
01-01 17:05:41.423 22570 22662 V SurfaceControl: SurfaceControl show : Surface(name=com.android.browser/com.opera.android.BrowserActivity)
01-01 17:05:41.427 22570 22662 V SurfaceControl: SurfaceControl hide: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 17:05:41.429 22570 22662 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true

可以看到下面的值为wenfeng : atoken != null truefalsefalsefalse,即atoken的hiddenRequested=true
boolean test = ((!isParentWindowHidden() && !atoken.hiddenRequested)
|| mWinAnimator.mAnimation != null || atoken.mAppAnimator.animation != null);

hiddenRequested=true这个要关注一下,为什么hiddenRequested为true

在AppWindowToken中修改hiddenRequested为true
01-01 17:24:55.270 29085 31013 V wenfeng : Changing app AppWindowToken{f24222e token=Token{154c0b ActivityRecord{f9fbfda u0 com.example.bookmark/.MainActivity t18}}} hidden=true performLayout=false com.android.server.wm.WindowSurfacePlacer.handleClosingApps:536 com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked:402 com.android.server.wm.RootWindowContainer.performSurfacePlacement:621 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:213 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:157
com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:147

不黑屏的log

01-01 17:29:19.759 29085 30646 D wenfeng : atoken != null truetruefalsefalse
01-01 17:29:19.759 29085 30646 D wenfeng : atoken != null return true
01-01 17:29:19.764 29085 29196 D wenfeng : atoken != null truetruefalsefalse
01-01 17:29:19.764 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:19.771 29085 29196 D wenfeng : atoken != null truetruefalsefalse
01-01 17:29:19.771 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:19.812 29085 29196 D wenfeng : atoken != null truetruefalsefalse
01-01 17:29:19.812 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:19.837 29085 29196 D wenfeng : atoken != null truetruefalsefalse
01-01 17:29:19.837 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:19.845 29085 31260 V wenfeng : setAppVisibility(Token{154c0b ActivityRecord{f9fbfda u0 com.example.bookmark/.MainActivity t18}}, visible=false): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=false hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityRecord.setVisible:1703 com.android.server.am.ActivityStack.makeInvisible:2574 com.android.server.am.ActivityStack.ensureActivitiesVisibleLocked:2324 com.android.server.am.ActivityStackSupervisor.ensureActivitiesVisibleLocked:3858 com.android.server.am.ActivityManagerService.ensureConfigAndVisibilityAfterUpdate:23707
01-01 17:29:19.846 29085 31260 V wenfeng : setAppVisibility(Token{fbdd84b ActivityRecord{1dd51a u0 com.android.browser/com.opera.Opera t19}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=true Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityStackSupervisor.realStartActivityLocked:1478 com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked:1705 com.android.server.am.ActivityStack.resumeTopActivityInnerLocked:3381 com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked:2735 com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked:2273
01-01 17:29:19.869 29085 31260 V wenfeng : setAppVisibility(Token{fbdd84b ActivityRecord{1dd51a u0 com.android.browser/com.opera.Opera t19}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityRecord.setVisible:1703 com.android.server.am.ActivityRecord.completeResumeLocked:1823 com.android.server.am.ActivityStack.minimalResumeActivityLocked:1345 com.android.server.am.ActivityStackSupervisor.realStartActivityLocked:1637 com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked:1705
01-01 17:29:19.902 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:19.902 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:19.919 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:19.919 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:19.936 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:19.936 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:19.950 29085 30609 V wenfeng : setAppVisibility(Token{fbdd84b ActivityRecord{1dd51a u0 com.android.browser/com.opera.Opera t19 f}}, visible=false): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityStack.finishActivityLocked:4676 com.android.server.am.ActivityStack.finishActivityLocked:4574 com.android.server.am.TaskRecord.performClearTaskLocked:1609 com.android.server.am.TaskRecord.performClearTaskForReuseLocked:1573 com.android.server.am.ActivityStarter.startActivityUnchecked:1819
01-01 17:29:19.954 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:19.954 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:19.976 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:19.976 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:19.980 29085 30646 V wenfeng : setAppVisibility(Token{74c1631 ActivityRecord{d4462d8 u0 com.android.browser/com.opera.android.BrowserActivity t19}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=true Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityStack.resumeTopActivityInnerLocked:3224 com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked:2735 com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked:2273 com.android.server.am.ActivityStack.completePauseLocked:1837 com.android.server.am.ActivityStack.activityPausedLocked:1734
01-01 17:29:19.997 29085 30646 V wenfeng : setAppVisibility(Token{74c1631 ActivityRecord{d4462d8 u0 com.android.browser/com.opera.android.BrowserActivity t19}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityRecord.setVisible:1703 com.android.server.am.ActivityRecord.completeResumeLocked:1823 com.android.server.am.ActivityStack.resumeTopActivityInnerLocked:3359 com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked:2735 com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked:2273
01-01 17:29:19.999 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:19.999 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.003 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.003 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.020 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.020 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.037 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.037 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.054 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.054 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.071 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.071 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.087 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.087 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.104 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.104 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.122 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.122 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.139 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.139 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.155 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.155 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.171 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.171 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.200 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.201 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.206 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.206 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.222 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.222 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.240 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.240 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.256 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.256 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.274 29085 29196 V wenfeng : Changing app AppWindowToken{f24222e token=Token{154c0b ActivityRecord{f9fbfda u0 com.example.bookmark/.MainActivity t18}}} hidden=true performLayout=false com.android.server.wm.WindowSurfacePlacer.handleClosingApps:536 com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked:402 com.android.server.wm.RootWindowContainer.performSurfacePlacement:621 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:213 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:157 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:147
01-01 17:29:20.277 29085 29196 V wenfeng : Changing app AppWindowToken{608d484 token=Token{74c1631 ActivityRecord{d4462d8 u0 com.android.browser/com.opera.android.BrowserActivity t19}}} hidden=false performLayout=false com.android.server.wm.WindowSurfacePlacer.handleOpeningApps:462 com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked:406 com.android.server.wm.RootWindowContainer.performSurfacePlacement:621 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:213 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:157 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:147
01-01 17:29:20.339 29085 29196 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:29:20.339 29085 29196 D wenfeng : atoken != null return true
01-01 17:29:20.340 29085 29196 V SurfaceControl: SurfaceControl show : Surface(name=com.android.browser/com.opera.android.BrowserActivity)
01-01 17:29:20.341 29085 29196 V SurfaceControl: SurfaceControl show : Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:29:20.347 29085 29196 V SurfaceControl: SurfaceControl hide: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 17:29:20.350 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.350 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.405 29085 29410 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.411 29085 29410 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.467 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.467 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.482 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.482 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.535 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.535 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.536 29085 29196 V SurfaceControl: SurfaceControl show : Surface(name=InputMethod)
01-01 17:29:20.549 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.549 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.627 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.628 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.629 29085 29196 V SurfaceControl: SurfaceControl hide: Surface(name=VColorFullScreenDisplay)
01-01 17:29:20.635 29085 29196 V SurfaceControl: SurfaceControl hide: Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:29:20.636 29085 29196 V SurfaceControl: SurfaceControl destroy: Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:29:20.638 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.651 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.653 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.653 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.662 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.662 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.680 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.680 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.694 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.694 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.711 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:29:20.711 29085 29196 D wenfeng : begin hide fuck
01-01 17:29:20.726 29085 29410 V SurfaceControl: SurfaceControl destroy: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 17:29:20.731 29085 29410 D wenfeng : isOnScreen() false  mHasSurface = false mDestroying=false mPolicyVisibility=true

黑屏的log

01-01 17:33:25.901 29085 30538 D wenfeng : atoken != null truetruefalsefalse
01-01 17:33:25.901 29085 30538 D wenfeng : atoken != null return true
01-01 17:33:25.912 29085 29196 D wenfeng : atoken != null truetruefalsefalse
01-01 17:33:25.912 29085 29196 D wenfeng : atoken != null return true
01-01 17:33:25.949 29085 29196 D wenfeng : atoken != null truetruefalsefalse
01-01 17:33:25.949 29085 29196 D wenfeng : atoken != null return true
01-01 17:33:25.972 29085 29196 D wenfeng : atoken != null truetruefalsefalse
01-01 17:33:25.972 29085 29196 D wenfeng : atoken != null return true
01-01 17:33:25.990 29085 30538 V wenfeng : setAppVisibility(Token{154c0b ActivityRecord{f9fbfda u0 com.example.bookmark/.MainActivity t18}}, visible=false): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=false hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityRecord.setVisible:1703 com.android.server.am.ActivityStack.makeInvisible:2574 com.android.server.am.ActivityStack.ensureActivitiesVisibleLocked:2324 com.android.server.am.ActivityStackSupervisor.ensureActivitiesVisibleLocked:3858 com.android.server.am.ActivityManagerService.ensureConfigAndVisibilityAfterUpdate:23707
01-01 17:33:25.991 29085 30538 V wenfeng : setAppVisibility(Token{8e53e1 ActivityRecord{7374948 u0 com.android.browser/com.opera.Opera t19}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=true Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityStackSupervisor.realStartActivityLocked:1478 com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked:1705 com.android.server.am.ActivityStack.resumeTopActivityInnerLocked:3381 com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked:2735 com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked:2273
01-01 17:33:26.013 29085 30538 V wenfeng : setAppVisibility(Token{8e53e1 ActivityRecord{7374948 u0 com.android.browser/com.opera.Opera t19}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityRecord.setVisible:1703 com.android.server.am.ActivityRecord.completeResumeLocked:1823 com.android.server.am.ActivityStack.minimalResumeActivityLocked:1345 com.android.server.am.ActivityStackSupervisor.realStartActivityLocked:1637 com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked:1705
01-01 17:33:26.025 29085 30538 V wenfeng : Changing app AppWindowToken{f24222e token=Token{154c0b ActivityRecord{f9fbfda u0 com.example.bookmark/.MainActivity t18}}} hidden=true performLayout=false com.android.server.wm.WindowSurfacePlacer.handleClosingApps:536 com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked:402 com.android.server.wm.RootWindowContainer.performSurfacePlacement:621 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:213 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:157 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:147
01-01 17:33:26.027 29085 30538 V wenfeng : Changing app AppWindowToken{61bb1f4 token=Token{8e53e1 ActivityRecord{7374948 u0 com.android.browser/com.opera.Opera t19}}} hidden=false performLayout=false com.android.server.wm.WindowSurfacePlacer.handleOpeningApps:462 com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked:406 com.android.server.wm.RootWindowContainer.performSurfacePlacement:621 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:213 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:157 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:147

01-01 17:33:26.062 29085 29196 D wenfeng : atoken != null truefalsefalsefalse
01-01 17:33:26.062 29085 29196 D wenfeng : atoken != null return false
01-01 17:33:26.062 29085 29196 D wenfeng : diao !!!!!atoken != null truefalsefalsefalse
01-01 17:33:26.062 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.062 29085 29196 I DetectBlack: No surface, maybe black! with hideSurface() surface:Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 17:33:26.063 29085 29196 V SurfaceControl: SurfaceControl hide: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 17:33:26.064 29085 29196 V SurfaceControl: SurfaceControl show : Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:33:26.065 29085 29196 I DetectBlack: Resume from black! showSurface surface:Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:33:26.115 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.115 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.188 29085 29753 V wenfeng : setAppVisibility(Token{8e53e1 ActivityRecord{7374948 u0 com.android.browser/com.opera.Opera t19 f}}, visible=false): mNextAppTransition=TRANSIT_ACTIVITY_CLOSE hidden=false hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityStack.finishActivityLocked:4676 com.android.server.am.ActivityStack.finishActivityLocked:4574 com.android.server.am.TaskRecord.performClearTaskLocked:1609 com.android.server.am.TaskRecord.performClearTaskForReuseLocked:1573 com.android.server.am.ActivityStarter.startActivityUnchecked:1819
01-01 17:33:26.193 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.193 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.196 29085 29196 I DetectBlack: No surface, maybe black! with hideSurface() surface:Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:33:26.196 29085 29196 V SurfaceControl: SurfaceControl hide: Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:33:26.197 29085 29196 V SurfaceControl: SurfaceControl hide: Surface(name=VColorFullScreenDisplay)
01-01 17:33:26.219 29085 31013 V wenfeng : setAppVisibility(Token{74c1631 ActivityRecord{d4462d8 u0 com.android.browser/com.opera.android.BrowserActivity t19}}, visible=true): mNextAppTransition=TRANSIT_ACTIVITY_CLOSE hidden=true hiddenRequested=true Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityStack.resumeTopActivityInnerLocked:3224 com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked:2735 com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked:2273 com.android.server.am.ActivityStack.completePauseLocked:1837 com.android.server.am.ActivityStack.activityPausedLocked:1734
01-01 17:33:26.236 29085 31013 V wenfeng : setAppVisibility(Token{74c1631 ActivityRecord{d4462d8 u0 com.android.browser/com.opera.android.BrowserActivity t19}}, visible=true): mNextAppTransition=TRANSIT_ACTIVITY_CLOSE hidden=true hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityRecord.setVisible:1703 com.android.server.am.ActivityRecord.completeResumeLocked:1823 com.android.server.am.ActivityStack.resumeTopActivityInnerLocked:3359 com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked:2735 com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked:2273
01-01 17:33:26.238 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.238 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.274 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.274 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.291 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.291 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.306 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.307 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.322 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.322 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.340 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.340 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.356 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.356 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.374 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.374 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.391 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.391 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.406 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.406 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.424 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.424 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.440 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.440 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.469 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.470 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.475 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.475 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.494 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.494 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.507 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.507 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.524 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.525 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.546 29085 29196 V wenfeng : Changing app AppWindowToken{61bb1f4 token=Token{8e53e1 ActivityRecord{7374948 u0 com.android.browser/com.opera.Opera t19}}} hidden=true performLayout=false com.android.server.wm.WindowSurfacePlacer.handleClosingApps:536 com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked:402 com.android.server.wm.RootWindowContainer.performSurfacePlacement:621 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:213 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:157 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:147

01-01 17:33:26.549 29085 29196 V wenfeng : Changing app AppWindowToken{608d484 token=Token{74c1631 ActivityRecord{d4462d8 u0 com.android.browser/com.opera.android.BrowserActivity t19}}} hidden=false performLayout=false com.android.server.wm.WindowSurfacePlacer.handleOpeningApps:462 com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked:406 com.android.server.wm.RootWindowContainer.performSurfacePlacement:621 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop:213 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:157 com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement:147
01-01 17:33:26.571 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.571 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.572 29085 29196 V SurfaceControl: SurfaceControl show : Surface(name=com.android.browser/com.opera.android.BrowserActivity)
01-01 17:33:26.572 29085 29196 I DetectBlack: Resume from black! showSurface surface:Surface(name=com.android.browser/com.opera.android.BrowserActivity)
01-01 17:33:26.573 29085 29196 V SurfaceControl: SurfaceControl show : Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:33:26.577 29085 29196 V SurfaceControl: SurfaceControl hide: Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:33:26.578 29085 29196 V SurfaceControl: SurfaceControl destroy: Surface(name=SnapshotStartingWindow for taskId=19)
01-01 17:33:26.580 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.611 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.612 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.646 29085 31262 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.651 29085 31262 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.666 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.667 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.704 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.704 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.757 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.757 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.804 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.805 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.806 29085 29196 V SurfaceControl: SurfaceControl show : Surface(name=InputMethod)
01-01 17:33:26.815 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.815 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.834 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.834 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.843 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.844 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.861 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.862 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.878 29085 29196 D wenfeng : isOnScreen() false  mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:33:26.879 29085 29196 D wenfeng : begin hide fuck
01-01 17:33:26.884 29085 29753 V SurfaceControl: SurfaceControl destroy: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 17:33:26.887 29085 29753 D wenfeng : isOnScreen() false  mHasSurface = false mDestroying=false mPolicyVisibility=true

打一下他的调用栈,看是如何黑的,是在pause时候黑的
01-01 17:43:58.369 3937 3955 V wenfeng : Changing app AppWindowToken{a0c194 token=Token{cd11991 ActivityRecord{537d7b8 u0 com.example.bookmark/.MainActivity t21}}} hidden=true performLayout=false
01-01 17:43:58.370 3937 3955 V wenfeng : Changing app
01-01 17:43:58.370 3937 3955 V wenfeng : java.lang.Throwable
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.wm.AppWindowToken.setVisibility(AppWindowToken.java:428)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleClosingApps(WindowSurfacePlacer.java:536)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked(WindowSurfacePlacer.java:402)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:621)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:213)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:157)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:147)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.continueLayout(WindowSurfacePlacer.java:138)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.wm.WindowManagerService.continueSurfaceLayout(WindowManagerService.java:3882)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.am.ActivityStack.activityPausedLocked(ActivityStack.java:1736)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.am.ActivityManagerService.activityPaused(ActivityManagerService.java:8633)
01-01 17:43:58.370 3937 3955 V wenfeng : at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:317)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3392)
01-01 17:43:58.370 3937 3955 V wenfeng : at com.android.server.am.OppoActivityManagerService.onTransact(OppoActivityManagerService.java:537)
01-01 17:43:58.370 3937 3955 V wenfeng : at android.os.Binder.execTransact(Binder.java:697)

不黑的log,不会打出上面的调用栈
01-01 17:45:52.082 3937 5185 V wenfeng : setAppVisibility(Token{cd11991 ActivityRecord{537d7b8 u0 com.example.bookmark/.MainActivity t21}}, visible=false): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=false hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityRecord.setVisible:1703 com.android.server.am.ActivityStack.makeInvisible:2574 com.android.server.am.ActivityStack.ensureActivitiesVisibleLocked:2324 com.android.server.am.ActivityStackSupervisor.ensureActivitiesVisibleLocked:3858 com.android.server.am.ActivityManagerService.ensureConfigAndVisibilityAfterUpdate:23707
01-01 17:45:52.083 3937 5185 V wenfeng : setAppVisibility(Token{c89b915 ActivityRecord{1e0f2cc u0 com.android.browser/com.opera.Opera t22}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=true Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityStackSupervisor.realStartActivityLocked:1478 com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked:1705 com.android.server.am.ActivityStack.resumeTopActivityInnerLocked:3381 com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked:2735 com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked:2273
01-01 17:45:52.106 3937 5185 V wenfeng : setAppVisibility(Token{c89b915 ActivityRecord{1e0f2cc u0 com.android.browser/com.opera.Opera t22}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityRecord.setVisible:1703 com.android.server.am.ActivityRecord.completeResumeLocked:1823 com.android.server.am.ActivityStack.minimalResumeActivityLocked:1345 com.android.server.am.ActivityStackSupervisor.realStartActivityLocked:1637 com.android.server.am.ActivityStackSupervisor.startSpecificActivityLocked:1705
01-01 17:45:52.135 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.135 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.151 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.152 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.168 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.168 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.185 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.185 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.202 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.202 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.219 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.219 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.224 3937 6133 V wenfeng : setAppVisibility(Token{c89b915 ActivityRecord{1e0f2cc u0 com.android.browser/com.opera.Opera t22 f}}, visible=false): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityStack.finishActivityLocked:4676 com.android.server.am.ActivityStack.finishActivityLocked:4574 com.android.server.am.TaskRecord.performClearTaskLocked:1609 com.android.server.am.TaskRecord.performClearTaskForReuseLocked:1573 com.android.server.am.ActivityStarter.startActivityUnchecked:1819
01-01 17:45:52.250 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.250 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.256 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.256 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.262 3937 3955 V wenfeng : setAppVisibility(Token{df57591 ActivityRecord{50423b8 u0 com.android.browser/com.opera.android.BrowserActivity t22}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=true Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityStack.resumeTopActivityInnerLocked:3224 com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked:2735 com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked:2273 com.android.server.am.ActivityStack.completePauseLocked:1837 com.android.server.am.ActivityStack.activityPausedLocked:1734
01-01 17:45:52.278 3937 3955 V wenfeng : setAppVisibility(Token{df57591 ActivityRecord{50423b8 u0 com.android.browser/com.opera.android.BrowserActivity t22}}, visible=true): mNextAppTransition=TRANSIT_TASK_TO_FRONT hidden=true hiddenRequested=false Callers=com.android.server.am.ActivityRecord.setVisibility:1685 com.android.server.am.ActivityRecord.setVisible:1703 com.android.server.am.ActivityRecord.completeResumeLocked:1823 com.android.server.am.ActivityStack.resumeTopActivityInnerLocked:3359 com.android.server.am.ActivityStack.resumeTopActivityUncheckedLocked:2735 com.android.server.am.ActivityStackSupervisor.resumeFocusedStackTopActivityLocked:2273
01-01 17:45:52.280 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.280 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.289 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.289 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.304 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.304 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.321 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.322 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.338 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.338 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.353 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.354 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.371 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.371 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.388 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.388 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.406 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.407 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.421 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.421 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.439 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.439 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.454 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.454 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.483 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.483 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.489 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.489 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.505 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.505 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.522 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.522 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.539 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.539 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.559 3937 4027 V wenfeng : Changing app AppWindowToken{a0c194 token=Token{cd11991 ActivityRecord{537d7b8 u0 com.example.bookmark/.MainActivity t21}}} hidden=true performLayout=false
01-01 17:45:52.559 3937 4027 V wenfeng : Changing app
01-01 17:45:52.559 3937 4027 V wenfeng : java.lang.Throwable
01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.AppWindowToken.setVisibility(AppWindowToken.java:428)
01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleClosingApps(WindowSurfacePlacer.java:536)
01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked(WindowSurfacePlacer.java:402)
01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:621)
01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:213)
01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:157)
01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:147)
01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.lambda-com_android_server_wm_WindowSurfacePlacer_5999(WindowSurfacePlacer.java:120) 01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.m13(Unknown Source:4) 01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.wm.-Lambda$aEpJ2RCAIjecjyIIYTv6ricEwh4.run(Unknown Source:63)
01-01 17:45:52.559 3937 4027 V wenfeng : at android.os.Handler.handleCallback(Handler.java:790)
01-01 17:45:52.559 3937 4027 V wenfeng : at android.os.Handler.dispatchMessage(Handler.java:99)
01-01 17:45:52.559 3937 4027 V wenfeng : at android.os.Looper.loop(Looper.java:197)
01-01 17:45:52.559 3937 4027 V wenfeng : at android.os.HandlerThread.run(HandlerThread.java:65)
01-01 17:45:52.559 3937 4027 V wenfeng : at com.android.server.ServiceThread.run(ServiceThread.java:46)
01-01 17:45:52.562 3937 4027 V wenfeng : Changing app AppWindowToken{86ad9cd token=Token{df57591 ActivityRecord{50423b8 u0 com.android.browser/com.opera.android.BrowserActivity t22}}} hidden=false performLayout=false
01-01 17:45:52.620 3937 3975 V SurfaceControl: SurfaceControl destroy: Surface(name=SnapshotStartingWindow for taskId=22)
01-01 17:45:52.623 3937 3975 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.623 3937 3975 D wenfeng : atoken != null return true
01-01 17:45:52.642 3937 4027 D wenfeng : atoken != null truefalsefalsetrue
01-01 17:45:52.643 3937 4027 D wenfeng : atoken != null return true
01-01 17:45:52.643 3937 4027 V SurfaceControl: SurfaceControl show : Surface(name=com.android.browser/com.opera.android.BrowserActivity)
01-01 17:45:52.650 3937 4027 V SurfaceControl: SurfaceControl hide: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 17:45:52.653 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.654 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.702 3937 4663 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.708 3937 4663 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.728 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.728 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.777 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.778 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.812 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.812 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.854 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.854 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.855 3937 4027 V SurfaceControl: SurfaceControl show : Surface(name=InputMethod)
01-01 17:45:52.860 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.860 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.886 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.886 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.887 3937 4027 V SurfaceControl: SurfaceControl hide: Surface(name=VColorFullScreenDisplay)
01-01 17:45:52.895 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.895 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.911 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.911 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.928 3937 4027 D wenfeng : isOnScreen() false mHasSurface = true mDestroying=true mPolicyVisibility=true
01-01 17:45:52.928 3937 4027 D wenfeng : begin hide fuck
01-01 17:45:52.943 3937 3955 V SurfaceControl: SurfaceControl destroy: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
01-01 17:45:52.947 3937 3955 D wenfeng : isOnScreen() false mHasSurface = false mDestroying=false mPolicyVisibility=true

今日进展:对比桌面,其实最后发现mrequesthideen都是返回true,但是atoken.mAppAnimator.animation不同,桌面不为空,而跳转浏览器时为空。

不出问题的情况,没有显示snapshot

 01-02 16:39:16.254 24243 24284 V SurfaceControl: SurfaceControl destroy: Surface(name=SnapshotStartingWindow for taskId=50)
    Line 109: 01-02 16:39:16.254 24243 24284 V SurfaceControl: SurfaceControl destroy: Surface(name=SnapshotStartingWindow for taskId=50)
    Line 138: 01-02 16:39:16.390 24243 24336 V SurfaceControl: SurfaceControl show : Surface(name=com.android.browser/com.opera.android.BrowserActivity)
    Line 138: 01-02 16:39:16.390 24243 24336 V SurfaceControl: SurfaceControl show : Surface(name=com.android.browser/com.opera.android.BrowserActivity)
    Line 148: 01-02 16:39:16.438 24243 24336 V SurfaceControl: SurfaceControl hide: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
    Line 148: 01-02 16:39:16.438 24243 24336 V SurfaceControl: SurfaceControl hide: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
    Line 163: 01-02 16:39:16.652 24243 24336 V SurfaceControl: SurfaceControl show : Surface(name=InputMethod)
    Line 163: 01-02 16:39:16.652 24243 24336 V SurfaceControl: SurfaceControl show : Surface(name=InputMethod)
    Line 164: 01-02 16:39:16.652 24243 24336 V SurfaceControl: SurfaceControl hide: Surface(name=VColorFullScreenDisplay)
    Line 164: 01-02 16:39:16.652 24243 24336 V SurfaceControl: SurfaceControl hide: Surface(name=VColorFullScreenDisplay)
    Line 171: 01-02 16:39:16.707 24243 25555 V SurfaceControl: SurfaceControl destroy: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)
    Line 171: 01-02 16:39:16.707 24243 25555 V SurfaceControl: SurfaceControl destroy: Surface(name=com.example.bookmark/com.example.bookmark.MainActivity)

01-02 16:39:16.325 24243 24336 V wenfeng : Changing app AppWindowToken{f404d92 token=Token{50ec706 ActivityRecord{354ade1 u0 com.android.browser/com.opera.android.BrowserActivity t50}}} hidden=false performLayout=false
01-02 16:39:16.389 24243 24336 D wenfeng : Window{6e49836 u0 com.example.bookmark/com.example.bookmark.MainActivity EXITING}atoken != null truefalsefalsetrue
01-02 16:39:16.389 24243 24336 D wenfeng : Window{6e49836 u0 com.example.bookmark/com.example.bookmark.MainActivity EXITING}atoken != null return true

这样设置null的,但不是这个导致的
01-02 17:32:47.987 32239 32343 V wenfeng : setNullAnimation
01-02 17:32:47.987 32239 32343 V wenfeng : java.lang.Throwable
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.AppWindowAnimator.setNullAnimation(AppWindowAnimator.java:196)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleOpeningApps(WindowSurfacePlacer.java:459)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked(WindowSurfacePlacer.java:406)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:621)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:213)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:157)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:147)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.lambda$-com_android_server_wm_WindowSurfacePlacer_5999(WindowSurfacePlacer.java:120)

奇怪了,setnull之后怎么还未true???

01-02 17:32:47.983 32239 32343 V wenfeng : setNullAnimation
01-02 17:32:47.983 32239 32343 V wenfeng : java.lang.Throwable
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.AppWindowAnimator.setNullAnimation(AppWindowAnimator.java:196)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleClosingApps(WindowSurfacePlacer.java:533)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked(WindowSurfacePlacer.java:402)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:621)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:213)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:157)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:147)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.lambda-com_android_server_wm_WindowSurfacePlacer_5999(WindowSurfacePlacer.java:120) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.m13(Unknown Source:4) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.run(Unknown Source:63) 01-02 17:32:47.983 32239 32343 V wenfeng : at android.os.Handler.handleCallback(Handler.java:790) 01-02 17:32:47.983 32239 32343 V wenfeng : at android.os.Handler.dispatchMessage(Handler.java:99) 01-02 17:32:47.983 32239 32343 V wenfeng : at android.os.Looper.loop(Looper.java:197) 01-02 17:32:47.983 32239 32343 V wenfeng : at android.os.HandlerThread.run(HandlerThread.java:65) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.ServiceThread.run(ServiceThread.java:46) 01-02 17:32:47.983 32239 32343 V wenfeng : setNullAnimation 01-02 17:32:47.983 32239 32343 V wenfeng : java.lang.Throwable 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.AppWindowAnimator.setNullAnimation(AppWindowAnimator.java:196) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleClosingApps(WindowSurfacePlacer.java:533) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked(WindowSurfacePlacer.java:402) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:621) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:213) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:157) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:147) 01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.lambda-com_android_server_wm_WindowSurfacePlacer_5999(WindowSurfacePlacer.java:120)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.m13(Unknown Source:4)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.run(Unknown Source:63)
01-02 17:32:47.983 32239 32343 V wenfeng : at android.os.Handler.handleCallback(Handler.java:790)
01-02 17:32:47.983 32239 32343 V wenfeng : at android.os.Handler.dispatchMessage(Handler.java:99)
01-02 17:32:47.983 32239 32343 V wenfeng : at android.os.Looper.loop(Looper.java:197)
01-02 17:32:47.983 32239 32343 V wenfeng : at android.os.HandlerThread.run(HandlerThread.java:65)
01-02 17:32:47.983 32239 32343 V wenfeng : at com.android.server.ServiceThread.run(ServiceThread.java:46)
01-02 17:32:47.985 32239 32343 V wenfeng : Changing app AppWindowToken{d8648a7 token=Token{986f8f4 ActivityRecord{593dac7 u0 com.example.bookmark/.MainActivity t53}}} hidden=true performLayout=false
01-02 17:32:47.985 32239 32343 V wenfeng : Changing app
01-02 17:32:47.985 32239 32343 V wenfeng : java.lang.Throwable
01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.AppWindowToken.setVisibility(AppWindowToken.java:428)
01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleClosingApps(WindowSurfacePlacer.java:536)
01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked(WindowSurfacePlacer.java:402)
01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:621)
01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:213)
01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:157)
01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:147)
01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.lambda-com_android_server_wm_WindowSurfacePlacer_5999(WindowSurfacePlacer.java:120) 01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.m13(Unknown Source:4) 01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.run(Unknown Source:63) 01-02 17:32:47.985 32239 32343 V wenfeng : at android.os.Handler.handleCallback(Handler.java:790) 01-02 17:32:47.985 32239 32343 V wenfeng : at android.os.Handler.dispatchMessage(Handler.java:99) 01-02 17:32:47.985 32239 32343 V wenfeng : at android.os.Looper.loop(Looper.java:197) 01-02 17:32:47.985 32239 32343 V wenfeng : at android.os.HandlerThread.run(HandlerThread.java:65) 01-02 17:32:47.985 32239 32343 V wenfeng : at com.android.server.ServiceThread.run(ServiceThread.java:46) 01-02 17:32:47.987 32239 32343 V wenfeng : setNullAnimation 01-02 17:32:47.987 32239 32343 V wenfeng : java.lang.Throwable 01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.AppWindowAnimator.setNullAnimation(AppWindowAnimator.java:196) 01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleOpeningApps(WindowSurfacePlacer.java:459) 01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked(WindowSurfacePlacer.java:406) 01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:621) 01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:213) 01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:157) 01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:147) 01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.lambda-com_android_server_wm_WindowSurfacePlacer_5999(WindowSurfacePlacer.java:120)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.m13(Unknown Source:4)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.run(Unknown Source:63)
01-02 17:32:47.987 32239 32343 V wenfeng : at android.os.Handler.handleCallback(Handler.java:790)
01-02 17:32:47.987 32239 32343 V wenfeng : at android.os.Handler.dispatchMessage(Handler.java:99)
01-02 17:32:47.987 32239 32343 V wenfeng : at android.os.Looper.loop(Looper.java:197)
01-02 17:32:47.987 32239 32343 V wenfeng : at android.os.HandlerThread.run(HandlerThread.java:65)
01-02 17:32:47.987 32239 32343 V wenfeng : at com.android.server.ServiceThread.run(ServiceThread.java:46)
01-02 17:32:47.988 32239 32343 V wenfeng : Changing app AppWindowToken{cfd7857 token=Token{6700c76 ActivityRecord{762e311 u0 com.android.browser/com.opera.android.BrowserActivity t52}}} hidden=false performLayout=false
01-02 17:32:48.062 32239 32343 D wenfeng : Window{66fd4a1 u0 com.example.bookmark/com.example.bookmark.MainActivity EXITING}atoken != null truefalsefalsetrue
01-02 17:32:48.062 32239 32343 D wenfeng : Window{66fd4a1 u0 com.example.bookmark/com.example.bookmark.MainActivity EXITING}atoken != null return true

妈的,setnull后马上设置动画,所以不黑
06-27 22:29:32.244 26678 26769 V wenfeng : setNullAnimationAppWindowToken{ab36224 token=Token{cfc2630 ActivityRecord{bb0c773 u0 com.example.bookmark/.MainActivity t99}}}
06-27 22:29:32.244 26678 26769 V wenfeng : java.lang.Throwable
06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.AppWindowAnimator.setNullAnimation(AppWindowAnimator.java:198)
06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleClosingApps(WindowSurfacePlacer.java:533)
06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked(WindowSurfacePlacer.java:402)
06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:621)
06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:213)
06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:157)
06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:147)
06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.lambda-com_android_server_wm_WindowSurfacePlacer_5999(WindowSurfacePlacer.java:120) 06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.m13(Unknown Source:4) 06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.wm.-LambdaaEpJ2RCAIjecjyIIYTv6ricEwh4.run(Unknown Source:63) 06-27 22:29:32.244 26678 26769 V wenfeng : at android.os.Handler.handleCallback(Handler.java:790) 06-27 22:29:32.244 26678 26769 V wenfeng : at android.os.Handler.dispatchMessage(Handler.java:99) 06-27 22:29:32.244 26678 26769 V wenfeng : at android.os.Looper.loop(Looper.java:197) 06-27 22:29:32.244 26678 26769 V wenfeng : at android.os.HandlerThread.run(HandlerThread.java:65) 06-27 22:29:32.244 26678 26769 V wenfeng : at com.android.server.ServiceThread.run(ServiceThread.java:46) 06-27 22:29:32.248 26678 26769 V wenfeng : setAnimationAppWindowToken{ab36224 token=Token{cfc2630 ActivityRecord{bb0c773 u0 com.example.bookmark/.MainActivity t99}}} 06-27 22:29:32.248 26678 26769 V wenfeng : java.lang.Throwable 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.AppWindowAnimator.setAnimation(AppWindowAnimator.java:135) 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.WindowManagerService.applyAnimationLocked(WindowManagerService.java:3242) 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.AppWindowToken.setVisibility(AppWindowToken.java:405) 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleClosingApps(WindowSurfacePlacer.java:536) 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.handleAppTransitionReadyLocked(WindowSurfacePlacer.java:402) 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.RootWindowContainer.performSurfacePlacement(RootWindowContainer.java:621) 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacementLoop(WindowSurfacePlacer.java:213) 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:157) 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.performSurfacePlacement(WindowSurfacePlacer.java:147) 06-27 22:29:32.248 26678 26769 V wenfeng : at com.android.server.wm.WindowSurfacePlacer.lambda-com_android_server_wm_WindowSurfacePlacer_5999(WindowSurfacePlacer.java:120)

问题点,这块代码在handleclosing app中,估计a==null了
Animation a = mAppTransition.loadAnimation(lp, transit, enter, displayConfig.uiMode,
displayConfig.orientation, frame, displayFrame, insets, surfaceInsets,
stableInsets, isVoiceInteraction, freeform, atoken.getTask().mTaskId);
if (a != null) {
if (DEBUG_ANIM) logWithStack(TAG, "Loaded animation " + a + " for " + atoken);
final int containingWidth = frame.width();
final int containingHeight = frame.height();
atoken.mAppAnimator.setAnimation(a, containingWidth, containingHeight, width,
height, mAppTransition.canSkipFirstFrame(),
mAppTransition.getAppStackClipMode(),
transit, mAppTransition.getTransitFlags());
}
} else {
atoken.mAppAnimator.clearAnimation();
}

06-28 22:26:43.328 8612 8716 D wenfeng : Loading animation for app transition. transit=TRANSIT_TASK_TO_FRONT enter=false frame=Rect(0, 0 - 1080, 2000) insets=Rect(0, 80 - 0, 0) surfaceInsets=Rect(0, 0 - 0, 0) Animation=android.view.animation.AnimationSet@ee01c21
这样的动画罗

为什么会没有动画设置呢?
TaskSnapshotSurface这个类中的create方法没有传入动画啊,但这样的话不就是原生的问题吗??
layoutParams.type = TYPE_APPLICATION_STARTING;
layoutParams.format = snapshot.getSnapshot().getFormat();
layoutParams.flags = (windowFlags & ~FLAG_INHERIT_EXCLUDES)
| FLAG_NOT_FOCUSABLE
| FLAG_NOT_TOUCHABLE;
layoutParams.privateFlags = PRIVATE_FLAG_TASK_SNAPSHOT
| (windowPrivateFlags & PRIVATE_FLAG_INHERITS);
layoutParams.token = token.token;
layoutParams.width = LayoutParams.MATCH_PARENT;
layoutParams.height = LayoutParams.MATCH_PARENT;
layoutParams.systemUiVisibility = sysUiVis;

你可能感兴趣的:(FrameW)