极力推荐Android 开发大总结文章:欢迎收藏
程序员Android 力荐 ,Android 开发者需要的必备技能
本篇文章主要介绍 Android 开发中 SystemServer进程启动 部分知识点,通过阅读本篇文章,您将收获以下内容:
前言 Android 系统服务
1.SystemServer 进程启动导图
2.SystemServer 启动过程分析
3.SystemServer 开启Service 流程
4.SystemServer 开启引导服务实现
5.SystemServer 开启核心服务实现
6.SystemServer 开启其他服务实现
前言 Android 系统服务
Android 系统服务 一
Android 系统服务 二
Android System 服务启动过程
1. SystemServer 进程启动导图
SystemServer 进程启动导图
2. SystemServer 启动过程分析
SystemServer 代码路径
\alps\frameworks\base\services\java\com\android\server\SystemServer.java
-
- main 方法
systemServer main 方法
-
- Run 方法中初始化 时间,时区,语言等
Run 方法中初始化信息
-
- 设置VM 内存,准备 main looper 初始化 Native 服务
设置VM 内存,准备 main looper 初始化 Native 服务
-
- 检测最近一次触发关机是否失败
performPendingShutdown
performPendingShutdown 实现
-
- 初始化 system context
初始化System context
-
- 创建 systemServiceManager
创建 systemServiceManager
-
- 将 systemServiceManager添加到LocalServices
将 systemServiceManager添加到LocalServices
-
- 初始化systemServer 线程池
初始化systemServer 线程池
3. SystemServer 开启Service 流程
开启Service
-
- 开启引导服务
开启引导服务导图
-
- 开启核心服务
开启核心服务 导图
-
- 开启其他服务
开启其他服务导图
4. SystemServer 开启引导服务实现
startBootstrapServices实现
startBootstrapServices1
startBootstrapServices 2
startBootstrapServices 3
5.SystemServer 开启核心服务实现
startCoreServices
startCoreServices
6.SystemServer 开启其他服务实现
startOtherServices
startOtherServices
startOtherServices
startOtherServices
startOtherServices
startOtherServices 确认各个Service 已准备就绪
启动SystemUI
启动SystemUI
确认watchdog Thrid app Location 等已准备好
至此,本篇已结束,如有不对的地方,欢迎您的建议与指正。同时期待您的关注,感谢您的阅读,谢谢!
如有侵权,请联系小编,小编对此深感抱歉,届时小编会删除文章,立即停止侵权行为,请您多多包涵。
小礼物走一走,来简书关注我