AMS启动过程

AMS启动过程

首先需要明白一点的是AMS的启动在SytemServer进程中启动的;

 public static void main(String[] args) {
    new SystemServer().run();
}

进入run()方法:

	  private void run() {
    

        
        //1.创建消息Looper
        Looper.prepareMainLooper();

        // Initialize native services.
        //2.加载了动态库libandroid_server.so
        System.loadLibrary("android_servers");

        // Check whether we failed to shut down last time we tried.
        // This call may not return.
        performPendingShutdown();

        // Initialize the system context.
        //3.创建系统的Context
        createSystemContext();

        // Create the system service manager.
        //4.创建SystemServiceManager
        mSystemServiceManager = new SystemServiceManager(mSystemContext);
       
   

    // Start services.
    try {
        traceBeginAndSlog("StartServices");
        //启动引导服务
        startBoo

你可能感兴趣的:(Android源码分析,Android)