From 11f468844b6231d58e30c4727446a9ff4304b1e7 Mon Sep 17 00:00:00 2001 From: Lukas0610 Date: Sat, 24 Feb 2018 09:12:33 +0100 Subject: [PATCH] universal7580: camera: fixed torch-on-delay Wrapped set_torch_mode() and increased API-version of CameraWrapper to 2.4 to trigger support for set_torch_mode() Change-Id: I0dbc89345a785fabd84edeb0290e94d4e57019a6 --- camera/CameraWrapper.cpp | 10 +++++++++- camera/CameraWrapper.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/camera/CameraWrapper.cpp b/camera/CameraWrapper.cpp index ed48529..82e941e 100644 --- a/camera/CameraWrapper.cpp +++ b/camera/CameraWrapper.cpp @@ -60,7 +60,7 @@ camera_module_t HAL_MODULE_INFO_SYM = { .set_callbacks = camera_set_callbacks, .get_vendor_tag_ops = camera_get_vendor_tag_ops, .open_legacy = camera_open_legacy, - .set_torch_mode = NULL, + .set_torch_mode = camera_set_torch_mode, .init = NULL, .reserved = {0}, }; @@ -118,3 +118,11 @@ static int camera_open_legacy(const struct hw_module_t* module, const char* id, return 0; return camera2_device_open(module, id, device); } + +static int camera_set_torch_mode(const char* camera_id, bool enabled) +{ + ALOGV("%s", __FUNCTION__); + if (check_vendor_module()) + return 0; + return gVendorModule->set_torch_mode(camera_id, enabled); +} diff --git a/camera/CameraWrapper.h b/camera/CameraWrapper.h index c8183d5..34e099f 100644 --- a/camera/CameraWrapper.h +++ b/camera/CameraWrapper.h @@ -31,3 +31,4 @@ static int camera_get_camera_info(int camera_id, struct camera_info *info); static int camera_set_callbacks(const camera_module_callbacks_t *callbacks); static void camera_get_vendor_tag_ops(vendor_tag_ops_t* ops); static int camera_open_legacy(const struct hw_module_t* module, const char* id, uint32_t halVersion, struct hw_device_t** device); +static int camera_set_torch_mode(const char* camera_id, bool enabled); -- 2.20.1