Android应用程序进程启动过程的源代码分析(七)
从peers.get(index)得到的是一个ZygoteConnection对象,表示一个Socket连接,接下来就是调用ZygoteConnection.runOnce函数进一步处理了。
上文调用了handleChildProc函数。
Step 7. ZygoteConnection.handleChildProc
这个函数定义在frameworks/base/core/java/com/android/internal/os/ZygoteConnection.java文件中:
- [java] view plaincopyclass ZygoteConnection {
- ......
- private void handleChildProc(Arguments parsedArgs,
- FileDescriptor[] descriptors, PrintStream newStderr)
- throws ZygoteInit.MethodAndArgsCaller {
- ......
- if (parsedArgs.runtimeInit) {
- RuntimeInit.zygoteInit(parsedArgs.remainingArgs);
- } else {
- ......
- }
- }
- ......
- }
由于在前面的Step 3中,指定了"--runtime-init"参数,表示要为新创建的进程初始化运行时库,因此,这里的parseArgs.runtimeInit值为true,于是就继续执行RuntimeInit.zygoteInit进一步处理了。
版权声明:
作者:后浪云
链接:https://www.idc.net/help/207408/
文章版权归作者所有,未经允许请勿转载。
THE END