Android11 SystemUI启动流程源码分析(二)——SystemUIService的启动

在SystemUIApplication创建完成后,SystemUIService的onCreate()方法会被调用,进而启动config.xml中定义的一些子模块。下面我们来看一下SystemUIService启动流程。

第零步:Zygote调用SystemServer的main方法启动SystemServer

参考:Android系统启动——5 zyogte进程(Java篇) - 简书

第一步:SystemServer的main()方法中调用SystemServer.run(),run()中调用startOtherServices()

/**
 * The main entry point from zygote.
 */
public static void main(String[] args) {
    new SystemServer().run();
}
private void run() {
    ... ...
    // Start services.
    try {
        startBootstrapServices(t);
        startCoreServices(t);
        startOtherServices(t); //run()中调用了startOtherServices()
     } 
    ... ...
}

第二步:startOtherServices()中通过AMS的回调方法ready(),调用startSystemUI()

// 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(() -> {
        ... ...  
        try {
            startSyste
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值