[Android Knowledge Notes] Application process (2)

Service startup principle

Send a startService request to AMS

When startService, it will first get the Binder proxy object of AMS , and initiate a startService request to AMS :

insert image description here

AMS handles the startService request

Next, let's look at the AMS side processing the startService request of the application:

insert image description here

Recall the application process startup process:

insert image description here

Next, if the application process where the Service is located is not started, it will report to AMS after starting the application process, and how AMS handles the Service in the attchApplicationLocked() method after receiving the application report :

Guess you like

Origin blog.csdn.net/lyabc123456/article/details/131734416