diff options
author | James Dong <jdong@google.com> | 2010-02-25 18:41:46 -0800 |
---|---|---|
committer | James Dong <jdong@google.com> | 2010-02-25 18:41:46 -0800 |
commit | e284bac7757ad732d0812eb6133125434ba66d5b (patch) | |
tree | ca8bfc576bd53f6b9bfe006a8aaed0a67d5d2b63 /media | |
parent | b8b283bd53594ce4bb6da47b3abff12a0a070f04 (diff) | |
download | frameworks_av-e284bac7757ad732d0812eb6133125434ba66d5b.zip frameworks_av-e284bac7757ad732d0812eb6133125434ba66d5b.tar.gz frameworks_av-e284bac7757ad732d0812eb6133125434ba66d5b.tar.bz2 |
Don't allow MediaRecorder.setParameter() to be invoked in the following states:
error, prepared or recording
bug - 2362412
Diffstat (limited to 'media')
-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); |