diff options
author | Santhosh Kumar H E <skhara@codeaurora.org> | 2014-01-21 19:21:42 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-02-27 05:01:12 -0800 |
commit | b2da1c165bb60154b7cc64db8b7d832fa02b2708 (patch) | |
tree | 9a695f64007217b00399651da4f19eca0a3c2fe6 /src/com/android/camera/VideoModule.java | |
parent | 40aad1d5fb7ad8828b25c502165eaa557327edc2 (diff) | |
download | android_packages_apps_Snap-b2da1c165bb60154b7cc64db8b7d832fa02b2708.tar.gz android_packages_apps_Snap-b2da1c165bb60154b7cc64db8b7d832fa02b2708.tar.bz2 android_packages_apps_Snap-b2da1c165bb60154b7cc64db8b7d832fa02b2708.zip |
Camera: Add a feature to choose where to store the picture and video
Add a feature to choose use SDcard or phone to store picture
and video captured by camera and camcorder.
Some of the changes are taken from:
I987a691c93edc4250fe0366d0623c85ea0152117
CRs-Fixed: 619806
Change-Id: I009df4c70f0a1b49b20750f806c799f025bb6197
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r-- | src/com/android/camera/VideoModule.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index f8db15bec..b3dd884e8 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -118,6 +118,8 @@ public class VideoModule implements CameraModule, private ComboPreferences mPreferences; private PreferenceGroup mPreferenceGroup; + private boolean mSaveToSDCard = false; + // Preference must be read before starting preview. We check this before starting // preview. private boolean mPreferenceRead; @@ -425,6 +427,9 @@ public class VideoModule implements CameraModule, mContentResolver = mActivity.getContentResolver(); + Storage.setSaveSDCard( + mPreferences.getString(CameraSettings.KEY_CAMERA_SAVEPATH, "0").equals("1")); + mSaveToSDCard = Storage.isSaveSDCard(); // Surface texture is from camera screen nail and startPreview needs it. // This must be done before startPreview. mIsVideoCaptureIntent = isVideoCaptureIntent(); @@ -1309,7 +1314,12 @@ public class VideoModule implements CameraModule, // Used when emailing. String filename = title + convertOutputFormatToFileExt(outputFileFormat); String mime = convertOutputFormatToMimeType(outputFileFormat); - String path = Storage.DIRECTORY + '/' + filename; + String path = null; + if (Storage.isSaveSDCard() && SDCard.instance().isWriteable()) { + path = SDCard.instance().getDirectory() + '/' + filename; + } else { + path = Storage.DIRECTORY + '/' + filename; + } String tmpPath = path + ".tmp"; mCurrentVideoValues = new ContentValues(9); mCurrentVideoValues.put(Video.Media.TITLE, title); @@ -2067,6 +2077,9 @@ public class VideoModule implements CameraModule, } mRestartPreview = false; mUI.updateOnScreenIndicators(mParameters, mPreferences); + Storage.setSaveSDCard( + mPreferences.getString(CameraSettings.KEY_CAMERA_SAVEPATH, "0").equals("1")); + mActivity.updateStorageSpaceAndHint(); } } |