com.android.phone进程启动流程

1.  system ready  【ActivityManagerService】

2. 获取系统属性为persist的app

3. startProcessLocked()启动进程

Code:

public void systemReady(final Runnable goingCallback) {  

            if (mFactoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) {  
                try {  
                    List apps = AppGlobals.getPackageManager().  
                        getPersistentApplications(STOCK_PM_FLAGS);  
                    if (apps != null) {  
                        int N = apps.size();  
                        int i;  
                       for (i=0; i
                            ApplicationInfo info  
                                = (ApplicationInfo)apps.get(i);  
                            if (info != null &&  
                                    !info.packageName.equals("android")) {  
                                addAppLocked(info);  
                            }  
                        }  
                    }  
                } catch (RemoteException ex) {  
                    // pm is in same process, this will never happen.  
                }  
            }     
}  



Log

sys_log.boot

14:49:01.388081  1222  1222 I ActivityManager: u0 : Start proc 1559:com.android.phone/1001 for added application com.android.phone

main_log.boot

14:49:02.062996  1559  1559 V PhoneApp: u0 : onCreate()...


refer:

http://blog.csdn.net/windskier/article/details/6560925

http://blog.csdn.net/shrimpcolo/article/details/43766579

你可能感兴趣的:(phone,android)