From d7a4d6dcb9a82eb5daad7ab897a1be5357ce19c3 Mon Sep 17 00:00:00 2001 From: "Wang, Jianfeng XA" Date: Tue, 27 May 2014 17:48:08 +0900 Subject: libcameraservice: Allow media server to disconnect camera even unlocked The camera service may fail to release the camera hardware instance in some use cases. When an application unlocked the camera before disconnect, disconnect from the application will not be accepted. And disconnect from media server will not be accepted also. Then, the camera hardware instance will not be released and a resource leak will be caused. Allow media server to disconnect the camera at all times even if the camera is unlocked. Change-Id: Icd5ed81bed242fa5947aa40ca85e4ca7fa7286e7 --- services/camera/libcameraservice/api1/CameraClient.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'services') diff --git a/services/camera/libcameraservice/api1/CameraClient.cpp b/services/camera/libcameraservice/api1/CameraClient.cpp index 55555fd..735a4ae 100644 --- a/services/camera/libcameraservice/api1/CameraClient.cpp +++ b/services/camera/libcameraservice/api1/CameraClient.cpp @@ -243,11 +243,6 @@ void CameraClient::disconnect() { return; } - if (mClientPid <= 0) { - LOG1("camera is unlocked (mClientPid = %d), don't tear down hardware", mClientPid); - return; - } - // Make sure disconnect() is done once and once only, whether it is called // from the user directly, or called by the destructor. if (mHardware == 0) return; -- cgit v1.1