/** Called when the windows associated app window container are drawn. */ privatevoidonWindowsDrawn(long timestampNs) { finalTransitionInfoSnapshotinfo= mTaskSupervisor .getActivityMetricsLogger().notifyWindowsDrawn(this, timestampNs); finalbooleanvalidInfo= info != null; finalintwindowsDrawnDelayMs= validInfo ? info.windowsDrawnDelayMs : INVALID_DELAY; final@WaitResult.LaunchState intlaunchState= validInfo ? info.getLaunchState() : WaitResult.LAUNCH_STATE_UNKNOWN; // The activity may have been requested to be invisible (another activity has been launched) // so there is no valid info. But if it is the current top activity (e.g. sleeping), the // invalid state is still reported to make sure the waiting result is notified. if (validInfo || this == getDisplayArea().topRunningActivity()) { mTaskSupervisor.reportActivityLaunched(false/* timeout */, this, windowsDrawnDelayMs, launchState); } finishLaunchTickingLocked(); if (task != null) { task.setHasBeenVisible(true); }
// Don't enable the screen until all existing windows have been drawn. if (!mForceDisplayEnabled) { // ... 省略部分原有代码 }
/* --- 注释掉以下原生逻辑(此部分逻辑已移至 ActivityRecord 处理) --- if (!mBootAnimationStopped) { Trace.asyncTraceBegin(TRACE_TAG_WINDOW_MANAGER, "Stop bootanim", 0); // stop boot animation // formerly we would just kill the process, but we now ask it to exit so it // can choose where to stop the animation. SystemProperties.set("service.bootanim.exit", "1"); mBootAnimationStopped = true; } if (!mForceDisplayEnabled && !checkBootAnimationCompleteLocked()) { ProtoLog.i(WM_DEBUG_BOOT, "performEnableScreen: Waiting for anim complete"); return; } try { IBinder surfaceFlinger = ServiceManager.getService("SurfaceFlinger"); if (surfaceFlinger != null) { ProtoLog.i(WM_ERROR, "******* TELLING SURFACE FLINGER WE ARE BOOTED!"); Parcel data = Parcel.obtain(); data.writeInterfaceToken("android.ui.ISurfaceComposer"); surfaceFlinger.transact(IBinder.FIRST_CALL_TRANSACTION, // BOOT_FINISHED data, null, 0); data.recycle(); } } catch (RemoteException ex) { ProtoLog.e(WM_ERROR, "Boot completed: SurfaceFlinger is dead!"); } --- 注释结束 --- */