UI 也可以理解位launcher, 啟動UI 齐唆,android 整個界面圖標就出來了巫击,用戶可以選擇啟動app,如滴滴外潜,愛奇藝...
在啟動launcher 之前,pm 已經(jīng)裝了所有的app , 這個時候就需要launcher 啟動贞间,然后以方格多屏方式展示給用戶
298:private int startActivity(IApplicationThread caller, Intent intent, Intent ephemeralIntent,
String resolvedType, ActivityInfo aInfo, ResolveInfo rInfo,
IVoiceInteractionSession voiceSession, IVoiceInteractor voiceInteractor,
IBinder resultTo, String resultWho, int requestCode, int callingPid, int callingUid,
String callingPackage, int realCallingPid, int realCallingUid, int startFlags,
ActivityOptions options, boolean ignoreTargetSecurity, boolean componentSpecified,
ActivityRecord[] outActivity, TaskRecord inTask)
---------------》doPendingActivityLaunchesLocked
-993----》startActivity
-----》startActivityUnchecked
-----》mTargetStack.startActivityLocked
---》resumeTopActivityInnerLocked
---》startPausingLocked
startPausingLocked
---》prev.app.thread.schedulePauseActivity
--ActivityThread.java--》schedulePauseActivity
-->發(fā)送H.PAUSE_ACTIVITY
----》handlePauseActivity
------>ActivityManager.getService().activityPaused(token); ////// stack.activityPausedLocked(
---->ActivityStack.activityPausedLocked
resumeTopActivityInnerLocked----> mStackSupervisor.startSpecificActivityLocked
----> ActivityManagerService.startProcessLocked
---->Process.start
----->
ActivityThread.main()
---》attach
---》attachApplication
---》attachApplication
--》ActivityManagerService.java.attachApplicationLocked
-->attachApplicationLocked
-->realStartActivityLocked()
--->app.thread.scheduleLaunchActivity 發(fā)送了LAUNCH_ACTIVITY
--ActivityThread--->handleLaunchActivity
--ActivityThread---》performLaunchActivity
-->activity.attach
-->mInstrumentation.callActivityOnPostCreate