From 7b3161b8ac511cf0dcc18aded00171f8cc07ae9a Mon Sep 17 00:00:00 2001 From: TheKit Date: Tue, 28 Jul 2026 13:15:00 +0300 Subject: flashlight: add a camera HAL backend Some flash drivers expose a sysfs node that only toggles the LED and leaves the duty and the flash safety timeout unset, so the LED goes out by itself. Drive the torch through the AIDL camera provider instead, which programs all three. Select it with "FlashlightBackend: camera-hal" in the device yaml. Needs libgbinder, so it is behind the ENABLE_LIBGBINDER build option. --- src/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 60f80e6..d23190e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,11 +4,17 @@ if (ENABLE_DEVICEINFO) add_definitions(-DENABLE_LIBDEVICEINFO) endif () +if (ENABLE_LIBGBINDER) + set(FLASHLIGHT_BINDER + flashlight-binder.c) +endif () + # handwritten sources set(SERVICE_MANUAL_SOURCES brightness.c datafiles.c ${FLASHLIGHT_DEVICEINFO} + ${FLASHLIGHT_BINDER} device-provider-mock.c device-provider-upower.c device-provider.c @@ -53,5 +59,5 @@ link_directories(${SERVICE_DEPS_LIBRARY_DIRS}) # the executable: lib + main() add_executable (${SERVICE_EXEC} main.c) -target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${DEVICEINFO_LIBRARIES}) +target_link_libraries (${SERVICE_EXEC} ${SERVICE_LIB} ${SERVICE_DEPS_LIBRARIES} ${DEVICEINFO_LIBRARIES} ${GBINDER_LIBRARIES}) install (TARGETS ${SERVICE_EXEC} RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}") -- cgit v1.2.3