summaryrefslogtreecommitdiffstats
path: root/media/libmedia
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2010-02-26 18:56:22 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-02-26 18:56:22 -0800
commit039db81d53e9be1c8f6a9b569fc4d4df5313cd0b (patch)
treeb91ea40efd0771d6a4e0e86dbf5d1243b283c0fa /media/libmedia
parent4dce37b10b90fec88261d1fe5bbef28a2494c83b (diff)
parent61701ced749232165a96112f579ab82ba5040e38 (diff)
downloadframeworks_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.cpp9
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);