Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is SystemServer for Android?

I looked into package com.android.server; from source code of Android. There is some docs which showing that it's main role to load other vital services as Activity/Package/Power etc when system starts but it's only my guess.

Could somebody explain more in detail what is key-role of SystemServer?

like image 245
ar-g Avatar asked Jan 07 '16 09:01

ar-g


2 Answers

Once the Linux kernel gets booted,the granddaddy Init will starts to run whose PID is 1, which will further starts all the Init related Daemon process like logd,Installd,ueventd,lmkd and Zygote Init

Further Zygote init will start the System server and It is just like a container holding various services like Powermanager service,Location Manager service, Acitivity Manager service.

For Example: Acitivity Manager service will further starts Launcher Activity.

You can verify the system server by the following command:

cat /proc/`pidof system_server`/task/*/comm

The system server code is in frameworks/base/services/java/com/android/server/, named as System_server.java.

Hence the system_server process starts all the system services. These services run as threads inside the system_server process.

like image 164
Praneesh Avatar answered Nov 04 '22 22:11

Praneesh


Here is an excellent presentation detailing out what SystemServer on android is.

And following is the list of services handled by Android System Server (from the same presentation):

enter image description here

like image 34
AndroidMechanic - Viral Patel Avatar answered Nov 04 '22 21:11

AndroidMechanic - Viral Patel