public static void main(String argv[]) {
//创建socketServer
800 zygoteServer.registerServerSocketFromEnv(socketName);
801 // In some configurations, we avoid preloading resources and classes eagerly.
802 // In such cases, we will preload things prior to our first fork.
803 if (!enableLazyPreload) {
//加载系统class和frameworkResource
807 preload(bootTimingsTraceLog);
811 }
814
//fork SystemServer进程
833 Runnable r = forkSystemServer(abiList, socketName, zygoteServer);
847 caller = zygoteServer.runSelectLoop(abiList);
848 } catch (Throwable ex) {
849 Log.e(TAG, "System zygote died with exception", ex);
850 throw ex;
851 }
854
855 // We're in the child process and have exited the select loop. Proceed to execute the
856 // command.
857 if (caller != null) {
858 caller.run();
859 }
860 }
123 static void preload(TimingsTraceLog bootTimingsTraceLog) {
129 preloadClasses();
132 preloadResources();
138 preloadOpenGL();
150 }