summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhuw <zhuw@codeaurora.org>2019-05-10 10:53:32 +0800
committerzhuw <zhuw@codeaurora.org>2019-05-10 10:53:32 +0800
commit975670ceb33c735693f567f06b9e8b9c5f64faa6 (patch)
tree699c8a1b070620298094281487d725080f5edb20
parentc746717d5419700437944dafafdc04fb5a5fcf41 (diff)
downloadandroid_packages_apps_Snap-975670ceb33c735693f567f06b9e8b9c5f64faa6.tar.gz
android_packages_apps_Snap-975670ceb33c735693f567f06b9e8b9c5f64faa6.tar.bz2
android_packages_apps_Snap-975670ceb33c735693f567f06b9e8b9c5f64faa6.zip
fix confilct on HFR and Time Lapse option
do not allow set these 2 option at the same time Change-Id: Ia6047e64925385fe1ef13597c1c5040fa18303cc CRs-Fixed:2448987
-rwxr-xr-xsrc/com/android/camera/SettingsActivity.java37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/com/android/camera/SettingsActivity.java b/src/com/android/camera/SettingsActivity.java
index fc4bb339a..ae7b48293 100755
--- a/src/com/android/camera/SettingsActivity.java
+++ b/src/com/android/camera/SettingsActivity.java
@@ -146,16 +146,14 @@ public class SettingsActivity extends PreferenceActivity {
}
if ( pref.getKey().equals(SettingsManager.KEY_VIDEO_HDR_VALUE) ) {
- ListPreference autoHdrPref = (ListPreference) findPreference(
- mSettingsManager.KEY_AUTO_HDR);
- if (pref.getSummary().equals("enable")) {
- // when enable the Video HDR, app will disable the AUTO HDR.
- autoHdrPref.setEnabled(false);
- autoHdrPref.setValue("disable");
- mSettingsManager.setValue(mSettingsManager.KEY_AUTO_HDR, "disable");
- } else {
- autoHdrPref.setEnabled(true);
- }
+ // when enable the Video HDR, app will disable the AUTO HDR.
+ updateConflictOptionState(SettingsManager.KEY_AUTO_HDR, pref,
+ "Disable", "disable");
+ }
+
+ if (pref.getKey().equals(SettingsManager.KEY_VIDEO_HIGH_FRAME_RATE)) {
+ updateConflictOptionState(SettingsManager.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL,
+ pref, "Off", "0");
}
if ( (pref.getKey().equals(SettingsManager.KEY_MANUAL_WB)) ) {
@@ -165,6 +163,25 @@ public class SettingsActivity extends PreferenceActivity {
}
};
+ /**
+ * This method is to enable or disable the option which is conflict with changed setting
+ * @param conflictKey key you want to change after setting is changed
+ * @param changedPref preference of setting which is just changed
+ * @param checkedValue Judgement condition of enable or disable. It is Entry not EntryValue
+ * @param targetValue EntryValue you want to set into conflictKey when you disable it
+ */
+ private void updateConflictOptionState(String conflictKey, Preference changedPref,
+ String checkedValue, String targetValue) {
+ ListPreference conflictPref = (ListPreference) findPreference(conflictKey);
+ if (!changedPref.getSummary().equals(checkedValue)) {
+ conflictPref.setValue(targetValue);
+ mSettingsManager.setValue(conflictKey, targetValue);
+ conflictPref.setEnabled(false);
+ } else {
+ conflictPref.setEnabled(true);
+ }
+ }
+
private void UpdateManualExposureSettings() {
//dismiss all popups first, because we need to show edit dialog
int cameraId = mSettingsManager.getCurrentCameraId();