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 ...