summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWang Han <416810799@qq.com>2018-11-15 14:34:33 +0800
committerMichael Bestas <mkbestas@lineageos.org>2019-11-09 22:47:37 +0200
commit8c1cbbbcce044f5b6faae231d1b97250dc39bc1e (patch)
tree3a45de216983d7a5b6acabc0c6d145fe87e61834
parentd7863012f81814119c9d6309df75829472f74cbb (diff)
downloadandroid_packages_apps_Snap-8c1cbbbcce044f5b6faae231d1b97250dc39bc1e.zip
android_packages_apps_Snap-8c1cbbbcce044f5b6faae231d1b97250dc39bc1e.tar.gz
android_packages_apps_Snap-8c1cbbbcce044f5b6faae231d1b97250dc39bc1e.tar.bz2
Snap: Add missing NULL check in updatePictureAndVideoSize()
* Fixes crash when enabling Qcfa Change-Id: I506a1d7da0b91bc48484bd251e0c6c9042962421 Signed-off-by: Chippa-a <vusal1372@gmail.com>
-rwxr-xr-xsrc/com/android/camera/SettingsManager.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/com/android/camera/SettingsManager.java b/src/com/android/camera/SettingsManager.java
index 8b4ef40..6d7a44d 100755
--- a/src/com/android/camera/SettingsManager.java
+++ b/src/com/android/camera/SettingsManager.java
@@ -355,18 +355,20 @@ public class SettingsManager implements ListMenu.SettingsListener {
}
public void updatePictureAndVideoSize() {
- ListPreference pictureSize = mPreferenceGroup.findPreference(KEY_PICTURE_SIZE);
- ListPreference videoQualityPref = mPreferenceGroup.findPreference(KEY_VIDEO_QUALITY);
+ ListPreference pictureSize = mPreferenceGroup.findPreference(KEY_PICTURE_SIZE);
+ ListPreference videoQualityPref = mPreferenceGroup.findPreference(KEY_VIDEO_QUALITY);
+ if (pictureSize != null) {
CameraSettings.formatPictureSizes(pictureSize,
getSupportedPictureSizeList(getCurrentCameraId()), mContext);
CameraSettings.resetIfInvalid(pictureSize);
- if (videoQualityPref != null) {
- videoQualityPref.setEntries(mContext.getResources().getStringArray(
- R.array.pref_camera2_video_quality_entries));
- videoQualityPref.setEntryValues(mContext.getResources().getStringArray(
- R.array.pref_camera2_video_quality_entryvalues));
- filterUnsupportedOptions(videoQualityPref,getSupportedVideoSize(
- getCurrentCameraId()));
+ }
+ if (videoQualityPref != null) {
+ videoQualityPref.setEntries(mContext.getResources().getStringArray(
+ R.array.pref_camera2_video_quality_entries));
+ videoQualityPref.setEntryValues(mContext.getResources().getStringArray(
+ R.array.pref_camera2_video_quality_entryvalues));
+ filterUnsupportedOptions(videoQualityPref,getSupportedVideoSize(
+ getCurrentCameraId()));
}
}