summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAngus Kong <shkong@google.com>2012-05-21 16:44:39 -0700
committerAngus Kong <shkong@google.com>2012-05-21 18:19:01 -0700
commiteb8c46a973012c0ab29337da803741530f2bf085 (patch)
treee3988e2d169fe423c1c989036abf14bf21960acd /src
parentb4bd308a1244d2aa1e16a65d9e2e36a6b08f81ea (diff)
downloadCamera-eb8c46a973012c0ab29337da803741530f2bf085.tar.gz
Quick capture should wait for effects recordings.
Should return to caller after effects recording results is saved. bug:6500915 Change-Id: I864c0fb6b355bcd567425d9c1cf9fe70fd9fdae4
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com/android/camera/VideoCamera.java30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java
index 758c78d2..0b277f0e 100755
--- a/src/com/android/camera/VideoCamera.java
+++ b/src/com/android/camera/VideoCamera.java
@@ -553,14 +553,16 @@ public class VideoCamera extends ActivityBase
doReturnToCaller(false);
}
- private void onStopVideoRecording(boolean valid) {
+ private void onStopVideoRecording() {
mEffectsDisplayResult = true;
boolean recordFail = stopVideoRecording();
if (mIsVideoCaptureIntent) {
- if (mQuickCapture) {
- doReturnToCaller(valid && !recordFail);
- } else if (!effectsActive() && !recordFail) {
- showAlert();
+ if (!effectsActive()) {
+ if (mQuickCapture) {
+ doReturnToCaller(!recordFail);
+ } else if (!recordFail) {
+ showAlert();
+ }
}
} else if (!recordFail){
// Start capture animation.
@@ -584,7 +586,7 @@ public class VideoCamera extends ActivityBase
boolean stop = mMediaRecorderRecording;
if (stop) {
- onStopVideoRecording(true);
+ onStopVideoRecording();
} else {
startVideoRecording();
}
@@ -913,7 +915,7 @@ public class VideoCamera extends ActivityBase
if (mMediaRecorderRecording) {
// Camera will be released in onStopVideoRecording.
- onStopVideoRecording(true);
+ onStopVideoRecording();
} else {
closeCamera();
if (!effectsActive()) releaseMediaRecorder();
@@ -971,7 +973,7 @@ public class VideoCamera extends ActivityBase
public void onBackPressed() {
if (mPaused) return;
if (mMediaRecorderRecording) {
- onStopVideoRecording(false);
+ onStopVideoRecording();
} else if (!collapseCameraControls()) {
super.onBackPressed();
}
@@ -1376,9 +1378,9 @@ public class VideoCamera extends ActivityBase
@Override
public void onInfo(MediaRecorder mr, int what, int extra) {
if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED) {
- if (mMediaRecorderRecording) onStopVideoRecording(true);
+ if (mMediaRecorderRecording) onStopVideoRecording();
} else if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED) {
- if (mMediaRecorderRecording) onStopVideoRecording(true);
+ if (mMediaRecorderRecording) onStopVideoRecording();
// Show the toast.
Toast.makeText(this, R.string.video_reach_size_limit,
@@ -1881,12 +1883,12 @@ public class VideoCamera extends ActivityBase
mBgLearningMessageFrame.setVisibility(View.GONE);
checkQualityAndStartPreview();
} else if (effectMsg == EffectsRecorder.EFFECT_MSG_RECORDING_DONE) {
- // TODO: This assumes the codepath from onStopVideoRecording. It
- // does not appear to cause problems for the other codepaths, but
- // should be properly thought through.
+ // This follows the codepath from onStopVideoRecording.
if (mEffectsDisplayResult && !addVideoToMediaStore()) {
if (mIsVideoCaptureIntent) {
- if (!mQuickCapture) {
+ if (mQuickCapture) {
+ doReturnToCaller(true);
+ } else {
showAlert();
}
} else {