May 2017
Beginner to intermediate
470 pages
10h 49m
English
We will use the lights hardware interface as an example to explain how HAL, system services, and hardware managers work together.

As shown in the preceding figure, when an application wants to access hardware resources, it has to get an instance of the hardware manager first. For goldfish lights, the code in the application may look as follows:
LightsManager lights = LocalServices.getService(LightsManager.class); mBacklight = lights.getLight(LightsManager.LIGHT_ID_BACKLIGHT); mBacklight.setBrightness(brightness);
The hardware manager talks to the system service to get hardware ...
Read now
Unlock full access