diff options
author | ztenghui <ztenghui@google.com> | 2013-10-14 20:36:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-10-14 20:36:52 +0000 |
commit | b27668f0d0a1d5049759a8448e1701e199e05c71 (patch) | |
tree | 659923a09e9fcebd95d0a25f6b335e1e90783914 | |
parent | ae1697302b4ef59bbfebdf1127bc73531ce550b7 (diff) | |
parent | 70bd024ea2019da185de5c999fd50beb0e30215e (diff) | |
download | android_packages_apps_Snap-b27668f0d0a1d5049759a8448e1701e199e05c71.tar.gz android_packages_apps_Snap-b27668f0d0a1d5049759a8448e1701e199e05c71.tar.bz2 android_packages_apps_Snap-b27668f0d0a1d5049759a8448e1701e199e05c71.zip |
Merge "Only delete the Uri coming from onMediaSaved" into gb-ub-photos-carlsbad
-rw-r--r-- | src/com/android/camera/VideoModule.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index 012376c82..83c5faf18 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -136,6 +136,7 @@ public class VideoModule implements CameraModule, // examined by the user. private String mCurrentVideoFilename; private Uri mCurrentVideoUri; + private boolean mCurrentVideoUriFromMediaSaved; private ContentValues mCurrentVideoValues; private CamcorderProfile mProfile; @@ -179,6 +180,7 @@ public class VideoModule implements CameraModule, public void onMediaSaved(Uri uri) { if (uri != null) { mCurrentVideoUri = uri; + mCurrentVideoUriFromMediaSaved = true; onVideoSaved(); mActivity.notifyNewMedia(uri); } @@ -478,11 +480,8 @@ public class VideoModule implements CameraModule, // TODO: It should be better to not even insert the URI at all before we // confirm done in review, which means we need to handle temporary video // files in a quite different way than we currently had. - // When the video capture intent doesn't contain the Uri info and the - // review is cancelled before taking a video, mCurrentVideoUri can be - // null. Also make sure we don't delete the Uri sent from the video - // capture intent. - if (mIsInReviewMode && mCurrentVideoUri != null) { + // Make sure we don't delete the Uri sent from the video capture intent. + if (mCurrentVideoUriFromMediaSaved) { mContentResolver.delete(mCurrentVideoUri, null, null); } mIsInReviewMode = false; @@ -962,6 +961,7 @@ public class VideoModule implements CameraModule, long requestedSizeLimit = 0; closeVideoFileDescriptor(); + mCurrentVideoUriFromMediaSaved = false; if (mIsVideoCaptureIntent && myExtras != null) { Uri saveUri = (Uri) myExtras.getParcelable(MediaStore.EXTRA_OUTPUT); if (saveUri != null) { |