diff options
author | Pannag Sanketi <psanketi@google.com> | 2011-11-15 16:48:02 -0800 |
---|---|---|
committer | Pannag Sanketi <psanketi@google.com> | 2011-11-15 16:48:02 -0800 |
commit | 55382a5b3e8baf34e71320ec36d72fc2c38b890e (patch) | |
tree | 7bc671e05cce5d258e250876e71ea5ccd90c68c4 /src | |
parent | 34238165cfdf04584587360dfcf21109bf09e144 (diff) | |
download | LegacyCamera-55382a5b3e8baf34e71320ec36d72fc2c38b890e.zip LegacyCamera-55382a5b3e8baf34e71320ec36d72fc2c38b890e.tar.gz LegacyCamera-55382a5b3e8baf34e71320ec36d72fc2c38b890e.tar.bz2 |
Fix crash: camera swap w/ custom Background video
The background uri was not getting stored when swapping the camera
leading to a crash. Now it is sent via the intent.
Related Bug: 5585381
Change-Id: I05aea8321f0d2df96f646119eddd6a8b6a8ac668
Diffstat (limited to 'src')
-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 f725f43..06d6e2f 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(); /* @@ -2093,14 +2097,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(); |