summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoModule.java
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-03-06 14:04:51 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-03-06 14:04:51 -0800
commit4036f931c5ef40b6b49ec15a4c46cb50e578837b (patch)
tree739bd73e3878c4d32fc217eaae908c6ed514d5f5 /src/com/android/camera/VideoModule.java
parent45cdd51ac9100f221b114c9c89648781afe7482e (diff)
parentb2da1c165bb60154b7cc64db8b7d832fa02b2708 (diff)
downloadandroid_packages_apps_Snap-4036f931c5ef40b6b49ec15a4c46cb50e578837b.tar.gz
android_packages_apps_Snap-4036f931c5ef40b6b49ec15a4c46cb50e578837b.tar.bz2
android_packages_apps_Snap-4036f931c5ef40b6b49ec15a4c46cb50e578837b.zip
Merge "Camera: Add a feature to choose where to store the picture and video"
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r--src/com/android/camera/VideoModule.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 0339ac9c2..8562b9636 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);
@@ -2091,6 +2101,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();
}
}