summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang, Jianfeng XA <jianfeng.xa.wang@sonymobile.com>2014-05-27 17:48:08 +0900
committerSteve Kondik <steve@cyngn.com>2016-03-22 17:14:35 -0700
commitd7a4d6dcb9a82eb5daad7ab897a1be5357ce19c3 (patch)
tree2d66c78859b0de113f5ce6c49932ac61777e494e
parent3df4facd824693020ec412cd4afcc8e469e31bb7 (diff)
downloadframeworks_av-d7a4d6dcb9a82eb5daad7ab897a1be5357ce19c3.zip
frameworks_av-d7a4d6dcb9a82eb5daad7ab897a1be5357ce19c3.tar.gz
frameworks_av-d7a4d6dcb9a82eb5daad7ab897a1be5357ce19c3.tar.bz2
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
-rw-r--r--services/camera/libcameraservice/api1/CameraClient.cpp5
1 files changed, 0 insertions, 5 deletions
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;