diff options
author | Igor Murashkin <iam@google.com> | 2014-06-20 11:27:03 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2014-06-20 11:27:03 -0700 |
commit | 3d07d1ad0e60fd2b9a25563a0c24faf7f1fb1afc (patch) | |
tree | 9bf082572c938810ee8916a3265dcbfc4e3a82e3 /services | |
parent | 23307f736759efbdc6125e1ec0abbc4b48036346 (diff) | |
download | frameworks_av-3d07d1ad0e60fd2b9a25563a0c24faf7f1fb1afc.zip frameworks_av-3d07d1ad0e60fd2b9a25563a0c24faf7f1fb1afc.tar.gz frameworks_av-3d07d1ad0e60fd2b9a25563a0c24faf7f1fb1afc.tar.bz2 |
camera: Let #connectLegacy calls through with unspecified HAL version
This enables the camera2 shim to open a camera1 device without
turning the error codes into a RuntimeException.
Change-Id: I08d9d1e30e72025c41bd54b702d7ae95b32257be
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index b8227a7..109b891 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -791,7 +791,14 @@ status_t CameraService::connectLegacy( /*out*/ sp<ICamera>& device) { - if (mModule->common.module_api_version < CAMERA_MODULE_API_VERSION_2_3) { + if (halVersion != CAMERA_HAL_API_VERSION_UNSPECIFIED && + mModule->common.module_api_version < CAMERA_MODULE_API_VERSION_2_3) { + /* + * Either the HAL version is unspecified in which case this just creates + * a camera client selected by the latest device version, or + * it's a particular version in which case the HAL must supported + * the open_legacy call + */ ALOGE("%s: camera HAL module version %x doesn't support connecting to legacy HAL devices!", __FUNCTION__, mModule->common.module_api_version); return INVALID_OPERATION; |