universal7580: Remove WIFI_DRIVER_NVRAM_PATH and WIFI_DRIVER_NVRAM_PATH_PARAM
[GitHub/LineageOS/android_device_samsung_universal7580-common.git] / camera / CameraWrapper.cpp
index ed48529624b8bd8a4f8ab73e0280b3c84adbdc5c..8dcf5c2742c355b15d2497a9e8cc9618edde7142 100644 (file)
 #include "CameraWrapper.h"
 #include "Camera2Wrapper.h"
 
+static int camera_device_open(const hw_module_t* module, const char* name,
+                hw_device_t** device);
+static int camera_get_number_of_cameras(void);
+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);
+
 static camera_module_t *gVendorModule = 0;
 
 static int check_vendor_module()
@@ -60,7 +69,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},
 };
@@ -113,8 +122,17 @@ 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)
 {
+    (void)halVersion;
     ALOGV("%s", __FUNCTION__);
     if (check_vendor_module())
         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);
+}