diff options
author | Yin-Chia Yeh <yinchiayeh@google.com> | 2017-01-31 16:00:20 -0800 |
---|---|---|
committer | Yin-Chia Yeh <yinchiayeh@google.com> | 2017-01-31 17:40:23 -0800 |
commit | fca2e7420997f0738435420c5363d96001467af1 (patch) | |
tree | 57c437efcaafbb790094feb52cc903a25bcee1ec /camera/common/1.0/default/CameraModule.cpp | |
parent | f2336a17920bb46afa6ef2126a304313142f1381 (diff) |
Camera: call setCallback before open_legacy
Some open_legacy implementations require a valid callback.
Test: the failing open_legacy call succeeds
Bug: 34854786
Change-Id: I461c7622bdf46a7cb7febfb7eeeb083288b4af03
Diffstat (limited to 'camera/common/1.0/default/CameraModule.cpp')
-rw-r--r-- | camera/common/1.0/default/CameraModule.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/camera/common/1.0/default/CameraModule.cpp b/camera/common/1.0/default/CameraModule.cpp index 5d9ae4d31a..3a4bc9c6a8 100644 --- a/camera/common/1.0/default/CameraModule.cpp +++ b/camera/common/1.0/default/CameraModule.cpp @@ -369,9 +369,11 @@ int CameraModule::getNumberOfCameras() { } int CameraModule::setCallbacks(const camera_module_callbacks_t *callbacks) { - int res; + int res = OK; ATRACE_BEGIN("camera_module->set_callbacks"); - res = mModule->set_callbacks(callbacks); + if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_1) { + res = mModule->set_callbacks(callbacks); + } ATRACE_END(); return res; } |