summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlikaid <likaid@codeaurora.org>2015-09-09 10:40:27 +0800
committerMichael Bestas <mikeioannina@cyanogenmod.org>2016-01-14 18:45:43 +0200
commit607a2f0b99886cb07b2d2b042d38bfb26da0f166 (patch)
tree19a9911810c6a10c98b1c8f05c3ec9c856487231 /src
parentf0e709d5d8d53e3d5611fc7f050a2fbaa79fc8f8 (diff)
downloadandroid_packages_apps_Snap-607a2f0b99886cb07b2d2b042d38bfb26da0f166.tar.gz
android_packages_apps_Snap-607a2f0b99886cb07b2d2b042d38bfb26da0f166.tar.bz2
android_packages_apps_Snap-607a2f0b99886cb07b2d2b042d38bfb26da0f166.zip
SnapdragonCamera: limit video file size on SD card
Videos over 4GB on SD card cannot be played correctly. Set a limit if video is stored on SD card. Change-Id: I9f658527c2f6ee4408b6f9c8c0b45e2b9ea9bf8b CRs-Fixed: 902533
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/VideoModule.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 99e352c10..c8efd47e3 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -99,6 +99,8 @@ public class VideoModule implements CameraModule,
private static final int SCREEN_DELAY = 2 * 60 * 1000;
+ private static final int SDCARD_SIZE_LIMIT = 4000 * 1024 * 1024;
+
private static final long SHUTTER_BUTTON_TIMEOUT = 0L; // 0ms
/**
@@ -1632,6 +1634,10 @@ public class VideoModule implements CameraModule,
maxFileSize = requestedSizeLimit;
}
+ if (Storage.isSaveSDCard() && maxFileSize > SDCARD_SIZE_LIMIT) {
+ maxFileSize = SDCARD_SIZE_LIMIT;
+ }
+
try {
mMediaRecorder.setMaxFileSize(maxFileSize);
} catch (RuntimeException exception) {