summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/common/CameraModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/camera/libcameraservice/common/CameraModule.cpp')
-rw-r--r--services/camera/libcameraservice/common/CameraModule.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/common/CameraModule.cpp b/services/camera/libcameraservice/common/CameraModule.cpp
index e5b12ae..5e0ac9f 100644
--- a/services/camera/libcameraservice/common/CameraModule.cpp
+++ b/services/camera/libcameraservice/common/CameraModule.cpp
@@ -57,6 +57,14 @@ CameraModule::CameraModule(camera_module_t *module) {
mCameraInfoMap.setCapacity(getNumberOfCameras());
}
+int CameraModule::init() {
+ if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4 &&
+ mModule->init != NULL) {
+ return mModule->init();
+ }
+ return OK;
+}
+
int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) {
Mutex::Autolock lock(mCameraInfoLock);
if (cameraId < 0) {
@@ -92,7 +100,7 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) {
assert(index != NAME_NOT_FOUND);
// return the cached camera info
*info = mCameraInfoMap[index];
- return 0;
+ return OK;
}
int CameraModule::open(const char* id, struct hw_device_t** device) {
@@ -160,4 +168,3 @@ void* CameraModule::getDso() {
}
}; // namespace android
-