diff options
author | Pannag Sanketi <psanketi@google.com> | 2011-11-16 10:34:42 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-16 10:34:42 -0800 |
commit | 1947bdb7e2d82f6d1e8e53223dbcf62dfa9c61dd (patch) | |
tree | 1bcaa1030be3019f9e485b02cd5a7852b1df144e /src/com/android | |
parent | 0d0c3896bfe72cf058d74d92de97e4c0922254d3 (diff) | |
parent | 55382a5b3e8baf34e71320ec36d72fc2c38b890e (diff) | |
download | LegacyCamera-1947bdb7e2d82f6d1e8e53223dbcf62dfa9c61dd.zip LegacyCamera-1947bdb7e2d82f6d1e8e53223dbcf62dfa9c61dd.tar.gz LegacyCamera-1947bdb7e2d82f6d1e8e53223dbcf62dfa9c61dd.tar.bz2 |
Merge "Fix crash: camera swap w/ custom Background video" into ics-mr1
Diffstat (limited to 'src/com/android')
-rwxr-xr-x | src/com/android/camera/VideoCamera.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 1e90544..80a9a4c 100755 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -192,6 +192,7 @@ public class VideoCamera extends ActivityBase private String mPrefVideoEffectDefault; private boolean mResetEffect = true; public static final String RESET_EFFECT_EXTRA = "reset_effect"; + public static final String BACKGROUND_URI_GALLERY_EXTRA = "background_uri_gallery"; private boolean mMediaRecorderRecording = false; private long mRecordingStartTime; @@ -371,6 +372,9 @@ public class VideoCamera extends ActivityBase // Do not reset the effect if users are switching between back and front // cameras. mResetEffect = getIntent().getBooleanExtra(RESET_EFFECT_EXTRA, true); + // If background replacement was on when the camera was switched, the + // background uri will be sent via the intent. + mEffectUriFromGallery = getIntent().getStringExtra(BACKGROUND_URI_GALLERY_EXTRA); resetEffect(); /* @@ -2112,14 +2116,19 @@ public class VideoCamera extends ActivityBase // Restart the activity to have a crossfade animation. // TODO: Use SurfaceTexture to implement a better and faster // animation. + Intent intent; if (mIsVideoCaptureIntent) { // If the intent is video capture, stay in video capture mode. - Intent intent = getIntent(); - intent.putExtra(RESET_EFFECT_EXTRA, false); - MenuHelper.gotoVideoMode(this, intent); + intent = getIntent(); } else { - MenuHelper.gotoVideoMode(this, false); + intent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA); } + // To maintain the same background in background replacer, we + // need to send the background video uri via the Intent (apart + // from the condition that the effects should not be reset). + intent.putExtra(BACKGROUND_URI_GALLERY_EXTRA, mEffectUriFromGallery); + intent.putExtra(RESET_EFFECT_EXTRA, false); + MenuHelper.gotoVideoMode(this, intent); finish(); } else { readVideoPreferences(); |