diff options
author | likaid <likaid@codeaurora.org> | 2015-09-09 10:40:27 +0800 |
---|---|---|
committer | likaid <likaid@codeaurora.org> | 2015-09-10 16:31:41 +0800 |
commit | f211beed5b921a1f0053fa256f073c4b26be9d74 (patch) | |
tree | aef48028a88fbc53cad02511a0d9a9a2ec841aec | |
parent | ed5330c39beb937fdb97a5f7c100232fab29f915 (diff) | |
download | android_packages_apps_Snap-f211beed5b921a1f0053fa256f073c4b26be9d74.tar.gz android_packages_apps_Snap-f211beed5b921a1f0053fa256f073c4b26be9d74.tar.bz2 android_packages_apps_Snap-f211beed5b921a1f0053fa256f073c4b26be9d74.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 ffbbc0ed4..e238ed814 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -97,6 +97,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 /** @@ -1404,6 +1406,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) { |