diff options
author | likaid <likaid@codeaurora.org> | 2015-09-09 10:40:27 +0800 |
---|---|---|
committer | Michael Bestas <mikeioannina@cyanogenmod.org> | 2016-01-14 18:45:43 +0200 |
commit | 607a2f0b99886cb07b2d2b042d38bfb26da0f166 (patch) | |
tree | 19a9911810c6a10c98b1c8f05c3ec9c856487231 | |
parent | f0e709d5d8d53e3d5611fc7f050a2fbaa79fc8f8 (diff) | |
download | android_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
-rw-r--r-- | src/com/android/camera/VideoModule.java | 6 |
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) { |