AMS是本书碰到的第一块难啃的骨头[①],涉及的知识点较多。为了帮助读者更好地理解AMS,本章将带领读者按五条不同的线来分析它。 · 第一条线:同其他服务一样,将分析SystemServer中AMS的调用轨迹。 · 第二条线:以am命令启动一个Activity为例,分析应用进程的创建、Activity的启动,以及它们和AMS之间的交互等知识。
在launcher中点击应用来启动应用。 1. 调用流程 1.1 start-activity-call ActivityTaskManagerService类:startActivity->ActivityStarter类:startActivityMayWait->mSupervisor.getActivityMetricsLogger().notifyActivityLaunching:log打印debug:notifyActivityLaunching: active:false, intent:Intent { act=android.intent.action.M...
(ActivityRecord r, ProcessRecord app, boolean andResume, boolean check) throws RemoteException { r.startFreezingScreenLocked(app 0); mService.mWindowManager.setApp(r,true); if(checkConfig) { ...//处理发生变化的情况 mService.updateConfigurationLockedconfig, r, false); } r.app =app;...