任务快照
1、亮屏会设置可见activity
06-04 08:07:15.443 746 1109 V WindowManager: setVisibility isFingerprintUnlock=false
06-04 08:07:15.444 746 1109 V WindowManager: setAppVisibility..mOpeningApps.add. 222 in visible
06-04 08:07:15.444 746 1109 V WindowManager: Set focused app to: AppWindowToken{912fb3f token=Token{c183c99 ActivityRecord{a3901e0 u0 com.itel.notepad/com.itel.controller.NoteCreateActivity t80}
06-04 08:07:15.447 746 1109 V WindowManager: prepare shutdown, then allowRotate = true
06-04 08:07:15.448 746 1109 V WindowManager: setVisibility isFingerprintUnlock=false
06-04 08:07:15.448 746 1109 V WindowManager: setAppVisibility..mOpeningApps.add. 222 in visible
2、创建 TaskSnapshot 时堆栈
06-04 08:07:15.454 746 1109 D at com.android.server.wm.AppWindowContainerController.scheduleAddStartingWindow(AppWindowContainerController.java:642)06-04 08:07:15.454 746 1109 D at com.android.server.wm.AppWindowContainerController.createSnapshot(AppWindowContainerController.java:655)
06-04 08:07:15.454 746 1109 D at com.android.server.wm.AppWindowContainerController.addStartingWindow(AppWindowContainerController.java:546)
06-04 08:07:15.454 746 1109 D at com.android.server.am.ActivityRecord.showStartingWindow(ActivityRecord.java:2196)
06-04 08:07:15.454 746 1109 D at com.android.server.am.ActivityRecord.showStartingWindow(ActivityRecord.java:2181)
06-04 08:07:15.454 746 1109 D at com.android.server.am.TaskRecord.addStartingWindowsForVisibleActivities(TaskRecord.java:2266)
06-04 08:07:15.454 746 1109 D at com.android.server.am.ActivityStack.addStartingWindowsForVisibleActivities(ActivityStack.java:1967)
06-04 08:07:15.454 746 1109 D at com.android.server.am.ActivityStackSupervisor.addStartingWindowsForVisibleActivities(ActivityStackSupervisor.java:3401)
06-04 08:07:15.454 746 1109 D at com.android.server.am.KeyguardController.keyguardGoingAway(KeyguardController.java:140)
06-04 08:07:15.454 746 1109 D at com.android.server.am.ActivityManagerService.keyguardGoingAway(ActivityManagerService.java:7887)
06-04 08:07:15.454 746 1109 D at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3397)
06-04 08:07:15.454 746 1109 D at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3251)
06-04 08:07:15.454 746 1109 D at android.os.Binder.execTransact(Binder.java:697)
06-04 08:07:15.454 746 1109 V WindowManager: Enqueueing ADD_STARTING
mService.mAnimationHandler.postAtFrontOfQueue(mAddStartingWindow);
private final Runnable mAddStartingWindow = () -> {
这个是在动画handler 中处理
WindowManager: Enqueueing ADD_STARTING //发送处理添加TaskSnapshot 的runnable
WindowManager: Add starting AppWindowContai //执行runnable
3、windowmanagerservice.java
WindowManager: addWindow: AppWindowToken{912fb3f token=Token{c183c99 ActivityRecord{a3901e0 u0 com.itel.notepad/com.itel.controller.NoteCreateActivity t80}}} startingWindow=Window{227eb6f u0 SnapshotStartingWindow for taskId=80}
public int addWindow(Session session, IWindow client, int seq, WindowManager.LayoutParams attrs, int viewVisibility, int displayId, Rect outContentInsets, Rect outStableInsets, Rect outOutsets, InputChannel outInputChannel) {
final AppWindowToken aToken = token.asAppWindowToken(); if (type == TYPE_APPLICATION_STARTING && aToken != null) { aToken.startingWindow = win; if (DEBUG_STARTING_WINDOW) Slog.v (TAG_WM, "addWindow: " + aToken + " startingWindow=" + win); }
这里添加启动窗口,类型是 TYPE_APPLICATION_STARTING类型
4、
final int drawState = mWinAnimator.mDrawState; if ((drawState == HAS_DRAWN || drawState == READY_TO_SHOW) && mAttrs.type != TYPE_APPLICATION_STARTING && mAppToken != null) { mAppToken.onFirstWindowDrawn(this, mWinAnimator); }
void onFirstWindowDrawn(WindowState win, WindowStateAnimator winAnimator) { firstWindowDrawn = true; // We now have a good window to show, remove dead placeholders removeDeadWindows(); if (startingWindow != null) { if (DEBUG_STARTING_WINDOW || DEBUG_ANIM) Slog.v(TAG, "Finish starting " + win.mToken + ": first real window is shown, no animation"); // If this initial window is animating, stop it -- we will do an animation to reveal // it from behind the starting window, so there is no need for it to also be doing its // own stuff. winAnimator.clearAnimation(); if (getController() != null) { getController().removeStartingWindow(); } } updateReportedVisibilityLocked(); }
有TaskSnapshot ,播放完移除TaskSnapshot。这里是app 第一个窗口准备好了,会移除TaskSnapshot ,这个是在
at com.android.server.wm.SnapshotStartingData.createStartingSurface(SnapshotStartingData.java:39)
at com.android.server.wm.AppWindowContainerController.lambda$-com_android_server_wm_AppWindowContainerController_5707(AppWindowContainerController.java:165)
里面到调用的,及创建surface 时调用的。