diff options
author | Wu-cheng Li <wuchengli@google.com> | 2009-12-15 12:29:25 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2009-12-15 12:43:07 +0800 |
commit | 6dfb03741e9ed0821fbd7fa6912f44bf76bebca6 (patch) | |
tree | 3271063180babd933df5e76db7c94a7441980131 /src | |
parent | 59595d1cad16653e73bfdf811386b037f8925569 (diff) | |
download | LegacyCamera-6dfb03741e9ed0821fbd7fa6912f44bf76bebca6.zip LegacyCamera-6dfb03741e9ed0821fbd7fa6912f44bf76bebca6.tar.gz LegacyCamera-6dfb03741e9ed0821fbd7fa6912f44bf76bebca6.tar.bz2 |
Do not set WB or effect if driver does not support it.
The app should always check if camera driver support the parameter
before setting it. Otherwise, the app will always crash if parameter
string changes.
b/2323831
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index b3ddb19..6dbbc23 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -1413,19 +1413,24 @@ public class VideoCamera extends NoSearchActivity } // Set white balance parameter. - String whiteBalance = Parameters.WHITE_BALANCE_AUTO; - if (mParameters.getSupportedWhiteBalance() != null) { - whiteBalance = mPreferences.getString( - CameraSettings.KEY_WHITE_BALANCE, - getString(R.string.pref_camera_whitebalance_default)); + String whiteBalance = mPreferences.getString( + CameraSettings.KEY_WHITE_BALANCE, + getString(R.string.pref_camera_whitebalance_default)); + if (isSupported(whiteBalance, + mParameters.getSupportedWhiteBalance())) { mParameters.setWhiteBalance(whiteBalance); + } else { + whiteBalance = mParameters.getWhiteBalance(); + if (whiteBalance == null) { + whiteBalance = Parameters.WHITE_BALANCE_AUTO; + } } // Set color effect parameter. - if (mParameters.getSupportedColorEffects() != null) { - String colorEffect = mPreferences.getString( - CameraSettings.KEY_COLOR_EFFECT, - getString(R.string.pref_camera_coloreffect_default)); + String colorEffect = mPreferences.getString( + CameraSettings.KEY_COLOR_EFFECT, + getString(R.string.pref_camera_coloreffect_default)); + if (isSupported(colorEffect, mParameters.getSupportedColorEffects())) { mParameters.setColorEffect(colorEffect); } |