5-9: System Server之main函数
2016-04-06 15:28:56 1 举报
System Server的main函数是Android系统启动的核心,负责创建和启动各种系统服务。在这段代码中,首先通过调用nativeStart()方法进入Java虚拟机(JVM)的世界。接着,执行一系列的初始化操作,如设置线程优先级、加载系统属性等。然后,创建并启动Binder线程池、Zygote进程以及各种系统服务,如ActivityManagerService、WindowManagerService等。最后,调用Looper.loop()方法进入消息循环,等待处理各种系统事件。整个过程中,System Server会根据不同的系统配置和服务需求,动态地加载和启动相应的模块。
作者其他创作
大纲/内容
mStackSupervisor.resumeTopActivitiesLocked();
frameworks/base/services/core/jni/com_android_server_SystemServer.cpp
frameworks/base/services/core/java/com/android/server/am/ActivityManagerService.java
System.loadLibrary(\"android_servers\");
mDisplayManagerService
mActivityManagerService.systemReady()
//启动HomeActivity
./frameworks/base/services/java/com/android/server/SystemServer.java
createSystemContext();
android_server_SystemServer_nativeInit()
mPowerManagerService
mSystemServiceManager = new SystemServiceManager(mSystemContext);
LED/backlight/App stat/WebView
nativeInit();
Looper.loop();
WindowManagerService
mActivityManagerService
mActivityManagerService.setSystemProcess();
//启动Java Services
startOtherServices();
mSystemServiceManager.startService(Installer.class);
startCoreServices();
new SystemServer().run();
// Initialize native services.
mPackageManagerService
InputManagerService
startBootstrapServices();
。。。Services
main() //SystemServer类的main函数
0 条评论
下一页