summaryrefslogtreecommitdiffstats
path: root/services/camera
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
commit2458d482c4822c6f9e6274f5bd12b6aea095a9cd (patch)
tree7ce2bbb63ccd835dd0fdee8096a99300700f08db /services/camera
parent82edd5431951f461058c07b73c0dbc093aa45c99 (diff)
parent036bc3e2cfc5a11c3f7ace41088c8936dae2e946 (diff)
downloadframeworks_av-2458d482c4822c6f9e6274f5bd12b6aea095a9cd.zip
frameworks_av-2458d482c4822c6f9e6274f5bd12b6aea095a9cd.tar.gz
frameworks_av-2458d482c4822c6f9e6274f5bd12b6aea095a9cd.tar.bz2
Merge "Camera2: Always disconnect in the client destructor" into jb-mr1-dev
Diffstat (limited to 'services/camera')
-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);