The system service and hardware manager

To analyze how the application accesses light hardware, refer to the figure of the lights service calling sequence. In an application, what calls the getService(LightsManager.class) function to get an instance of LightsManager as follows:

LightsManager lights =  LocalServices.getService(LightsManager.class); mBacklight = lights.getLight(LightsManager.LIGHT_ID_BACKLIGHT); 

Usually the hardware manager and system service are implemented in different processes for most hardware interfaces. However, the hardware of the light is so simple, so both the system service and hardware manager are implemented in the same process.

The system service includes two parts: Java and JNI. The JNI implementation can be ...

Get Android System Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.