android 开机向导加载过程,开机向导启动流程分析

本文详细分析了Android开机向导的加载过程,从Bootloader到ActivityManagerService的systemReady方法,再到启动HomeActivity。重点介绍了ActivityManagerService的startHomeActivityLocked方法如何启动响应android.intent.category.HOME的应用,如Provision应用,即开机向导。Provision应用在完成设备配置后,会设置相关系统标志并自我禁用,确保开机向导仅执行一次。
摘要由CSDN通过智能技术生成

开机向导启动流程

首先来看Android启动流程:

1、Bootloader(系统启动加载器,将Linux加载到RAM);

2、Kernel

3、init进程

4、Zygote(Zygote进程是整个android系统的根进程,fork出System server进程);

5、system_server(Android系统的核心进程,负责启动各种系统服务);

6、System Services(由system_server调用startBootstrapServices()、startCoreServices()、

startOtherServices()三个方法启动各种服务,其中重要的服务启动顺序如下:

ActivityManagerService

PowerManagerService

PackageManagerService

WindowManagerService

StorageManagerService);

接下来就是开机向导的启动过程。

一、在SystemServer类的startOtherServices()方法中,当启动了所有需要的服务后,会调用ActivityManagerService类的systemReady()方法,代码如下:

private void startOtherServices() {

final Context context = mSystemContext;

VibratorService vibrator = null;

...

// We now tell the activity manager it is okay to run third party

// code. It will call back into us once it has gotten to the state

// where third party code can really run (but before it has actually

// started launching the initial applications), for us to complete our

// initialization.

mActivityManagerService.systemReady(() -> {

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值