summaryrefslogtreecommitdiffstats
path: root/services/camera
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-10-10 15:28:53 -0700
committerEino-Ville Talvala <etalvala@google.com>2012-10-10 15:28:53 -0700
commit907e5651c18d0e25073743a49a685fe1a385939a (patch)
tree398b985712df6ab64745cf59fbbbc82e7d023774 /services/camera
parent55f6c9dfd713776e251655b3ddd496b17df0926e (diff)
downloadframeworks_av-907e5651c18d0e25073743a49a685fe1a385939a.zip
frameworks_av-907e5651c18d0e25073743a49a685fe1a385939a.tar.gz
frameworks_av-907e5651c18d0e25073743a49a685fe1a385939a.tar.bz2
Camera2: Don't let unlocks happen during recording.
Bug: 7309020 Change-Id: I6e66809b868d2e8f47f71e6f8752b44ec06dfb17
Diffstat (limited to 'services/camera')
-rw-r--r--services/camera/libcameraservice/Camera2Client.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp
index cd9da42..0ab4e8c 100644
--- a/services/camera/libcameraservice/Camera2Client.cpp
+++ b/services/camera/libcameraservice/Camera2Client.cpp
@@ -454,9 +454,13 @@ status_t Camera2Client::unlock() {
ALOGV("%s: Camera %d: Unlock call from pid %d; current client pid %d",
__FUNCTION__, mCameraId, getCallingPid(), mClientPid);
- // TODO: Check for uninterruptable conditions
-
if (mClientPid == getCallingPid()) {
+ SharedParameters::Lock l(mParameters);
+ if (l.mParameters.state == Parameters::RECORD ||
+ l.mParameters.state == Parameters::VIDEO_SNAPSHOT) {
+ ALOGD("Not allowed to unlock camera during recording.");
+ return INVALID_OPERATION;
+ }
mClientPid = 0;
mCameraClient.clear();
mSharedCameraClient.clear();