Rasmus Nørgaard
Masters on Mobile
Published in
2 min readMar 24, 2015

--

System Server and Service Manager

Having looked at the Zygote process, we now move on to take a look at the System Server and the Service Managers involvement in the start up process.

The System Server as mentioned earlier, was launched by the Zygote process and is a separate process that continues to live throughout the system life time. The System Server basically initializes the Application Framework layer. It starts almost all of the Java system services. Although not present in the process list figures we saw previously (https://medium.com/masters-on-mobile/android-runtime-c840177e9929), the services that start with com.android, such as com.android.phone and com.android.email are started here. Also incluced are all the managers such as the Location Manager, Bluetooth Manager, Activity Manager etc. By simply running the adb shell with the ps command, it is easy to verify that the process’ PPID (Parent Process ID) is the same as that of the System Server (1).

The System Server then goes and registers all these services with the Service Manager. As we saw earlier the Service Manager was one of the first runtime services started by the kernels init call. The reason the Service Manager starts so early is because it needs to be ready for other system services to register their availability. Once registered, clients in the application layer may request access to services in the System Server via the Service Manager. This is now possible because all the services were registered there by the System Server. Because processes run in different VM’s and are restricted from contacting one another directly, requests for services goes from the client through the Binder in the kernel to the System Server and onto the specific service where it is handled.
To sum up we might say the System Service acts as a kind of Yellow Pages that holds a directory of all running system services and acts as a look up service for client applications (2).

(1) Deep Dive into Android IPC/Binder Framework (https://www.youtube.com/watch?v=Jgampt1DOak&index=6&list=FL-GRN1PTUfi9iiwdZpi9kUQ)

(2) Embedded Android

--

--