1.PackageMS 相关框架类
2.PackageMS 启动过程
2.1 # SystemServer.java
/** 291 * The main entry point from zygote. 292 */ 293 public static void main(String[] args) { 294 new SystemServer().run(); 295 }
上面是SystemServer的主函数。
private void run() {
// Start services. 427 try { 428 traceBeginAndSlog("StartServices"); 429 startBootstrapServices(); // 在这个里面启动PMS 430 startCoreServices(); 431 startOtherServices(); 432 SystemServerInitThreadPool.shutdown(); 433 } catch (Throwable ex) { 434 Slog.e("System", "******************************************"); 435 Slog.e("System", "************ Failure starting system services", ex); 436 throw ex; 437 } finally { 438 traceEnd(); 439 }
}
private void startBootstrapServices(){
...
traceBeginAndSlog("StartPackageManagerService"); 628 mPackageManagerService = PackageManagerService.main(mSystemContext, installer, 629 mFactoryTestMode != FactoryTest.FACTORY_TEST_OFF, mOnlyCore); 630 mFirstBoot = mPackageManagerService.isFirstBoot(); 631 mPackageManager = mSystemContext.getPackageManager();
...
}
2.2 SystemServer