summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();