diff options
author | James Dong <jdong@google.com> | 2010-02-26 18:56:22 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-02-26 18:56:22 -0800 |
commit | 039db81d53e9be1c8f6a9b569fc4d4df5313cd0b (patch) | |
tree | b91ea40efd0771d6a4e0e86dbf5d1243b283c0fa /media/libmedia | |
parent | 4dce37b10b90fec88261d1fe5bbef28a2494c83b (diff) | |
parent | 61701ced749232165a96112f579ab82ba5040e38 (diff) | |
download | frameworks_base-039db81d53e9be1c8f6a9b569fc4d4df5313cd0b.zip frameworks_base-039db81d53e9be1c8f6a9b569fc4d4df5313cd0b.tar.gz frameworks_base-039db81d53e9be1c8f6a9b569fc4d4df5313cd0b.tar.bz2 |
Merge "Don't allow MediaRecorder.setParameter() to be invoked in the following states: error, prepared or recording"
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/mediarecorder.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/media/libmedia/mediarecorder.cpp b/media/libmedia/mediarecorder.cpp index 23024e9..5adc116 100644 --- a/media/libmedia/mediarecorder.cpp +++ b/media/libmedia/mediarecorder.cpp @@ -365,6 +365,15 @@ status_t MediaRecorder::setParameters(const String8& params) { return INVALID_OPERATION; } + bool isInvalidState = (mCurrentState & + (MEDIA_RECORDER_PREPARED | + MEDIA_RECORDER_RECORDING | + MEDIA_RECORDER_ERROR)); + if (isInvalidState) { + LOGE("setParameters is called in an invalid state: %d", mCurrentState); + return INVALID_OPERATION; + } + status_t ret = mMediaRecorder->setParameters(params); if (OK != ret) { LOGE("setParameters(%s) failed: %d", params.string(), ret); |