Merge "napdragonCamera: Fix crash when swith to fisheye" into camera.lnx.1.0-dev.1.0
diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java
old mode 100644
new mode 100755
index 825c95d..472630b
--- a/src/com/android/camera/VideoMenu.java
+++ b/src/com/android/camera/VideoMenu.java
@@ -777,21 +777,25 @@
.getInt("persist.camcorder.eis.maxfps", 30);
ListPreference hfrPref = mPreferenceGroup
.findPreference(CameraSettings.KEY_VIDEO_HIGH_FRAME_RATE);
- if (hfrPref != null) {
- String highFrameRate = hfrPref.getValue();
- boolean isHFR = "hfr".equals(highFrameRate.substring(0,3));
- boolean isHSR = "hsr".equals(highFrameRate.substring(0,3));
- int rate = 0;
- if ( isHFR || isHSR ) {
- String hfrRate = highFrameRate.substring(3);
- rate = Integer.parseInt(hfrRate);
- }
+ String highFrameRate;
+ if (hfrPref == null) {
+ //If hfrPref is null, use whitespace instead.
+ highFrameRate = " ";
+ } else {
+ highFrameRate = hfrPref.getValue();
+ }
+ boolean isHFR = "hfr".equals(highFrameRate.substring(0,3));
+ boolean isHSR = "hsr".equals(highFrameRate.substring(0,3));
+ int rate = 0;
+ if ( isHFR || isHSR ) {
+ String hfrRate = highFrameRate.substring(3);
+ rate = Integer.parseInt(hfrRate);
+ }
- if ((disMode.equals("enable") && rate > PERSIST_EIS_MAX_FPS)
- || !videoHDR.equals("off")
- || timeLapseInterval != 0) {
- mListMenu.setPreferenceEnabled(CameraSettings.KEY_VIDEO_HIGH_FRAME_RATE, false);
- }
+ if ((disMode.equals("enable") && rate > PERSIST_EIS_MAX_FPS)
+ || !videoHDR.equals("off")
+ || timeLapseInterval != 0) {
+ mListMenu.setPreferenceEnabled(CameraSettings.KEY_VIDEO_HIGH_FRAME_RATE, false);
}
}