当前位置:网站首页>Activity startup process

Activity startup process

2022-06-25 00:25:00 lcj908692

Launcher request AMS Stage

AMS To ApplicationThread Stage

ApplicationThread To Activity start-up

Code / Detail analysis

Launcher -->AMS

 

final IBinder b = ServiceManager.getService(Context.ACTIVITY_SERVICE);

final IActivityManager am = IActivityManager.Stub.asInterface(b); // binder signal communication

return am;

Come here :launcher adopt binder The communication is transferred to AMS In the

  The second stage :AMS To ActivityThread

 

  

 

 

 

 

 

final ActivityManagerService mService;

 

 

public void schedule() throws RemoteException {

mClient.scheduleTransaction(this);

} // This is through interprocess communication , Call to ActivityThread Of scheduleTransaction() in

 

 

ActivityStackSupervisor  Class ,addCall() Method is added LaunchActivityItem object

public static LaunchActivityItem obtain(.....){.....}

Client yes ClientTransactionHandler object , namely Called ClientTransactionHandler Object's handleLaunchActivity() Methods

client.handleLaunchActivity(r, pendingActions, null /* customIntent */);

because ClientTransactionHandler Of handleLaunchActivity() It's an abstract method , So find the implementation class

 ActivityThread Inherited ClientTransactionHandler. So it is called ActivityThread Of handleLaunchActivity() Methods

 

原网站

版权声明
本文为[lcj908692]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202210548098767.html