首页天道酬勤android的activity,安卓系统启动流程

android的activity,安卓系统启动流程

张世龙 05-06 09:26 37次浏览

Android S startActivity流程启动分析Activity的startActivity执行instrumentation.execstartactivity ()方法

publicactivityresultexecstartactivity (上下文世卫组织,I binder上下文thread,IBinder token,活动目标,Intent intent,int intent.preparetoleaveprocess (世卫组织; int result=activitytaskmanager.getservice (.start activity ) whothread,who.getOpPackageName ),who.getattributity target.mEmbeddedID : null,请求代码,0,null,options; checkstartactivityresult (result,intent ); }远程操作系统(catch ) thrownewruntimeexception (' failurefromsystem ',e ); }返回空值; }然后执行ActivityTaskManagerService的startActivity方法

@ overridepublicfinalintstartactivity (iapplicationthreadcaller,String callingPackage,String callingFeatureId,intententention IBinder resultTo,String resultWho,int requestCode,int startFlags,ProfilerInfo profilerInfo,bundleboptions (返回启动标志) callingPackage,callingFeatureId,intent,resolvedType,resultTo,startFlags,profilerInfo,bOptions,user handle.geted 还有活动标志和

检查权限时,最终调用startactivityunchecked (-startactivityinner ) )。 活动启动器由任务启动锁定(

com.Android.server.WM.task #.startactivitylocked-ensureactivitiesvisible

正在运行ensurevisibleactivitiesconfighelper.process activity

void process (activityrecordstart,布尔预览窗口) if ) start==null|! start.mvisiblerequested ({ return; } reset (保留窗口); finalpooledfunctionf=pooled lambda.obtain function (ensurevisibleactivitiesconfighelper : process activity,this,PPP true/*包含边界* /,true /*traverseTopToBottom*/); f .回复(; if (MUP dateconfig (//ensuretheresumedstateofthefocusactivityifweupdatedtheconfigurationof//any activity.mrootwindowindowcccion

esumetopactivityinnerlocked-activitytasksupervisor.startspecificactivity

- activitytasksupervisor.realstartactivitylocked

booleanrealstartactivitylocked (活动记录器,WindowProcessController proc,布尔和恢复, booleancheckconfig (throwsremoteexception (/部分代码)/createactivitylaunchtransaction.finalclienttransactionclienttrantransachation 客户端传输. add callback (launchactivityitem.obtain (new intent (r.intent ),System.identityHashCode(r ),r //todo : havethistakethemergedconfigurationinsteadofseparateglobal//andoverrideconfigs.merged configuration.getglobatiobal 合并配置. getoverrideconfiguration (,r.compat,r.launchedFromPackage,task.voiceInteractor, 是proc .r.getsavedstate (,r.getPersistentSavedState )、results、newIntents、r.takeOptions )、isTransitionForward activityClientController,r.createfixedrotationadjustmentsifneeded (,r.shareableActivityToken,r.shareableactoken )

@ overridepublicvoidexecute (客户端翻译助手客户端,I binder令牌,pendingtransactionspendingactions ) TRAC ctions访问client.handlelaunchactivity(r,pendingActions,null/*自定义intent */); trace.trace end (trace _ tag _ activity _ manager; }最后在ActivityThread的hanleLaunchActivity和performLaunchActivity中。 从mInstrumentation创建activity实例,获取应用程序实例(如果不存在,则调用instrumentation.newApplication )

handleResumeActivity是如何触发的? 在hanleLaunchActivity之后,通过TransactionExecutor执行ResumeActivityItem的execute方法。 执行handleResumeActivity方法。

Android的启动模式,android的activity