universal7580: camera: fixed torch-on-delay
authorLukas0610 <mail@lukasberger.at>
Sat, 24 Feb 2018 08:12:33 +0000 (09:12 +0100)
committerJan Altensen <info@stricted.net>
Fri, 16 Aug 2019 21:18:45 +0000 (23:18 +0200)
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
camera/CameraWrapper.h

index ed48529624b8bd8a4f8ab73e0280b3c84adbdc5c..82e941efb4162ddd4b59178facf3ca7683db8641 100644 (file)
@@ -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);
+}
index c8183d58186988c627c022ef26d2dfd389ebe5d3..34e099fae0c31376f33ef09ead31d7b09a3a25ff 100644 (file)
@@ -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);