summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-10-08 22:20:47 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-08 22:20:47 -0700
commit19caf26b1ab1619020aa417d7913c11fd1d5590d (patch)
treed5cd51a2f62db49a644f3c62f2d58861593435dd /services
parent0ad293aac9af377606fb4aa752b95547a8462791 (diff)
parentbe8d28a12e8d08531c6053bcf8ad1183c2f6e6d3 (diff)
downloadframeworks_av-19caf26b1ab1619020aa417d7913c11fd1d5590d.zip
frameworks_av-19caf26b1ab1619020aa417d7913c11fd1d5590d.tar.gz
frameworks_av-19caf26b1ab1619020aa417d7913c11fd1d5590d.tar.bz2
Merge "Camera2: Always disconnect in the client destructor" into jb-mr1-dev
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/CameraService.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 6fbd6ed..124d24d 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -409,6 +409,9 @@ CameraService::Client::Client(const sp<CameraService>& cameraService,
// tear down the client
CameraService::Client::~Client() {
mCameraService->releaseSound();
+
+ // unconditionally disconnect. function is idempotent
+ Client::disconnect();
}
// ----------------------------------------------------------------------------
@@ -433,6 +436,7 @@ CameraService::Client* CameraService::Client::getClientFromCookie(void* user) {
return client;
}
+// NOTE: function is idempotent
void CameraService::Client::disconnect() {
mCameraService->removeClient(mCameraClient);
mCameraService->setCameraFree(mCameraId);