May 2017
Beginner to intermediate
470 pages
10h 49m
English
The goldfish lights HAL implementation can be found in the $AOSP/device/generic/goldfish/lights folder. To implement the HAL layer, the hardware vendor usually needs to implement the following three data structures:
struct hw_module_t; struct hw_module_methods_t; struct hw_device_t;
All the preceding three data structures are implemented in the lights_qemu.c file for goldfish. In the HAL implementation, we need to define struct hw_module_t named HAL_MODULE_INFO_SYM first as follows. This registers the hardware module ID LIGHTS_HARDWARE_MODULE_ID in the system. After this, lights system service can get the module using the hw_get_module function:
/* * The emulator lights Module */ struct hw_module_t HAL_MODULE_INFO_SYM ...
Read now
Unlock full access