summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2012-10-10 17:17:01 -0700
committerEino-Ville Talvala <etalvala@google.com>2012-10-10 17:18:38 -0700
commita14be59340219c47639ec77a352d2af362551a6f (patch)
treef5d7b5a06cd58cfc7c7bfa2acfae16f5278644b1
parent7e2c0a15bb8086460070811a152029726479a297 (diff)
downloadframeworks_av-a14be59340219c47639ec77a352d2af362551a6f.zip
frameworks_av-a14be59340219c47639ec77a352d2af362551a6f.tar.gz
frameworks_av-a14be59340219c47639ec77a352d2af362551a6f.tar.bz2
Camera2: Don't error out of startPreview when already recording.
Bug: 7327474 Change-Id: I603da5b8bd58e5a700d7ae0b3d34bd89bbcb1d53
-rw-r--r--services/camera/libcameraservice/Camera2Client.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp
index 0ab4e8c..7290663 100644
--- a/services/camera/libcameraservice/Camera2Client.cpp
+++ b/services/camera/libcameraservice/Camera2Client.cpp
@@ -611,10 +611,13 @@ status_t Camera2Client::startPreviewL(Parameters &params, bool restart) {
ALOGV("%s: state == %d, restart = %d", __FUNCTION__, params.state, restart);
- if (params.state == Parameters::PREVIEW && !restart) {
- // Succeed attempt to re-enter preview state
- ALOGI("%s: Not starting preview; already in preview state.",
- __FUNCTION__);
+ if ( (params.state == Parameters::PREVIEW ||
+ params.state == Parameters::RECORD ||
+ params.state == Parameters::VIDEO_SNAPSHOT)
+ && !restart) {
+ // Succeed attempt to re-enter a streaming state
+ ALOGI("%s: Camera %d: Preview already active, ignoring restart",
+ __FUNCTION__, mCameraId);
return OK;
}
if (params.state > Parameters::PREVIEW && !restart) {