From 3fec0e568834dfacb0a10455297c7cddfaeb2f51 Mon Sep 17 00:00:00 2001 From: Sai Kumar Sanagavarapu Date: Mon, 21 Dec 2015 15:51:03 +0530 Subject: cameraservice: Change the error mapping for ERROR_CAMERA_DEVICE. In case of API1-HAL3, if HAL reports CAMERA3_MSG_ERROR_DEVICE, it is getting mapped to CAMERA_ERROR_UNKNOWN in the service layer. But this particular error code is not handled properly even in applications like GoogleCamera (Android default camera app). For example if camera deamon gets killed when GoogleCamera is previewing, since its not handling the error properly, preview freeze is seen for long time followed by mediaserver crash if any user interaction happens meanwhile. Ideally, app should close gracefully based on the error received. So, map CAMERA3_MSG_ERROR_DEVICE to CAMERA_ERROR_SERVER_DIED, so that app and mediaserver gets closed gracefully. Change-Id: Idad9d23262e28e85b020b5bacdaad7c77fe16372 --- services/camera/libcameraservice/api1/Camera2Client.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'services/camera') diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index 4338d64..1821636 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -1741,8 +1741,6 @@ void Camera2Client::notifyError(ICameraDeviceCallbacks::CameraErrorCode errorCod err = CAMERA_ERROR_RELEASED; break; case ICameraDeviceCallbacks::ERROR_CAMERA_DEVICE: - err = CAMERA_ERROR_UNKNOWN; - break; case ICameraDeviceCallbacks::ERROR_CAMERA_SERVICE: err = CAMERA_ERROR_SERVER_DIED; break; -- cgit v1.1