diff options
author | codeworkx <codeworkx@cyanogenmod.org> | 2016-01-07 21:36:55 +0100 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-11-02 12:22:27 -0700 |
commit | 8e599e58874a63f58f1d0c74d65f1dbaf539a374 (patch) | |
tree | 85ed643afe42d7fcf7d18f4936da1a5e5830adc4 /src/com/android | |
parent | 4eeddc1ccd1f4030d20cbe68848fb011e9daec55 (diff) | |
download | android_packages_apps_Snap-8e599e58874a63f58f1d0c74d65f1dbaf539a374.tar.gz android_packages_apps_Snap-8e599e58874a63f58f1d0c74d65f1dbaf539a374.tar.bz2 android_packages_apps_Snap-8e599e58874a63f58f1d0c74d65f1dbaf539a374.zip |
Snap: add fallback for invalid video qualities
Might happen when updating from previous versions of Snap
Change-Id: Ib52a2daff5a45c33ede1effd7cb7bed2fe61e5cc
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/camera/VideoModule.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java index e74dcfdbf..a19dddd05 100644 --- a/src/com/android/camera/VideoModule.java +++ b/src/com/android/camera/VideoModule.java @@ -957,6 +957,13 @@ public class VideoModule implements CameraModule, } mPreferences.edit().putString(CameraSettings.KEY_VIDEO_QUALITY, videoQuality).apply(); } + + // videoQuality must be at least 3 chars long (1x1) and contain the letter "x" + if (videoQuality.length() < 3 && !videoQuality.contains("x")) { + Log.e(TAG, "Invalid video quality " + videoQuality + ". Fallback to 352x288."); + videoQuality = "352x288"; + } + int quality = CameraSettings.VIDEO_QUALITY_TABLE.get(videoQuality); // Set video quality. |