diff options
author | ztenghui <ztenghui@google.com> | 2013-10-14 11:15:44 -0700 |
---|---|---|
committer | ztenghui <ztenghui@google.com> | 2013-10-14 12:36:15 -0700 |
commit | 70bd024ea2019da185de5c999fd50beb0e30215e (patch) | |
tree | a7f0e35c7260ab61aeb487d27ba3be60d4f9e2e5 | |
parent | 98b2a282a212b74d756c169a445e8d3f6089fb66 (diff) | |
download | android_packages_apps_Snap-70bd024ea2019da185de5c999fd50beb0e30215e.tar.gz android_packages_apps_Snap-70bd024ea2019da185de5c999fd50beb0e30215e.tar.bz2 android_packages_apps_Snap-70bd024ea2019da185de5c999fd50beb0e30215e.zip |
Only delete the Uri coming from onMediaSaved
The incoming Uri can be null, or a file Uri, which we don't want to delete.
The Uri from onMediaSaved has been inserted to the MediaStore and pass null
check.
bug:11218007
Change-Id: Ie4b08cae94e22a8014ea2436f0a82eba2541a667
-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) { |