Android has 3 categories of service, in different frame layers of the Android system, specifically interpreted as follows:
1) service in Init.rc
Service Servicemanager/system/bin/servicemanager
Class Core
User System
Group system
Critical
Onrestart Restart HEALTHD
Onrestart Restart Zygote
Onrestart Restart Media
Onrestart Restartsurfaceflinger
Onrestart Restart DRM
In fact, this kind of service is to define the start-up program, the object of the class service is a binary program that can be executed. It is defined as a service to better describe the properties of the binary run, such as running the user, the group, starting once (oneshot) or starting again (the program will start again when it dies). What's more, it can also describe the relationship between the various programs. For example, Onrestart restart DRM, which means that when the DRM program restarts, the program is also actively restarted.
2) System-level service
The service is close to what we usually understand, that is, services in the system, which defines the service interface that the other modules can use through that interface. The execution of such a service can be either binary or Java code. Like what:
C + + type of service:
Surfaceflinger,cameramanagerservice, Mediaplayerservice
Java type of service:
Activitymanagerservice,windowmanagerservice, Networkmanagerservice
The implementation mechanism is that the service registers its services with the ServiceManager mentioned above, and other modules get the interface of the service from ServiceManager by name. In the shell, the command "service list" can list all of the service types in the system.
3) service at the SDK layer
Unlike the previous two types of service, they are a generic term for a class of objects, and the service is a very specific Java class Android.app.Service.java that developers often contact. It is used by Android SDK exposed to third-party apps. It is equivalent to Activity and is one of the four main components of Android (Activity,service, Provider, Broadcastreceiver).
Summary:
First class service: System Integration Engineer is responsible for
The second type of Service:framework system engineer is responsible for
Third-class service: Daily intimate contact for Android app developers in mortal beings
Android system various types of service root planing interpretation