赞
踩
在SystemServer启动时,在进入PHASE_ACTIVITY_MANAGER_READY阶段,该阶段会告诉ActivityManager可以启动三方代码。并进行相关的初始化。
frameworks/base/services/java/com/android/server/SystemServer.java
{
…...
mActivityManagerService.systemReady(() -> {//ams调用systemReady()进行初始化
Slog.i(TAG, "Making services ready");
traceBeginAndSlog("StartActivityManagerReadyPhase");
mSystemServiceManager.startBootPhase(
SystemService.PHASE_ACTIVITY_MANAGER_READY);//设置系统启动阶段550.
traceEnd();
……
}
frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
public void systemReady(final Runnable goingCallback, TimingsTraceLog traceLog) {
traceLog.traceBegin("PhaseActivityManagerReady");
synchronized(this) {
if (mSystemReady) {
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。