summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/CameraSettings.java20
-rw-r--r--src/com/android/camera/PhotoMenu.java12
-rw-r--r--src/com/android/camera/PhotoModule.java65
3 files changed, 60 insertions, 37 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 66a022b..bc717c7 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -931,7 +931,7 @@ public class CameraSettings {
if (chromaFlash != null) {
List<String> supportedAdvancedFeatures =
getSupportedAdvancedFeatures(mParameters);
- if (!CameraUtil.isSupported(
+ if (hasChromaFlashScene(mContext) || !CameraUtil.isSupported(
mContext.getString(R.string
.pref_camera_advanced_feature_value_chromaflash_on),
supportedAdvancedFeatures)) {
@@ -957,6 +957,13 @@ public class CameraSettings {
supportedSceneModes.add(mContext.getString(R.string
.pref_camera_advanced_feature_value_optizoom_on));
}
+ if (hasChromaFlashScene(mContext) && CameraUtil.isSupported(
+ mContext.getString(R.string
+ .pref_camera_advanced_feature_value_chromaflash_on),
+ supportedAdvancedFeatures)) {
+ supportedSceneModes.add(mContext.getString(R.string
+ .pref_camera_advanced_feature_value_chromaflash_on));
+ }
filterUnsupportedOptions(group, sceneMode, supportedSceneModes);
}
if (flashMode != null) {
@@ -1411,4 +1418,15 @@ public class CameraSettings {
return split(str);
}
+ public static boolean hasChromaFlashScene(Context context) {
+ String[] sceneModes = context.getResources().getStringArray(
+ R.array.pref_camera_scenemode_entryvalues);
+ for (String mode : sceneModes) {
+ if (mode.equals(context.getResources().getString(R.string
+ .pref_camera_advanced_feature_value_chromaflash_on))) {
+ return true;
+ }
+ }
+ return false;
+ }
}
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index 35d721d..6b40e0c 100644
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -1168,6 +1168,18 @@ public class PhotoMenu extends MenuController
mActivity.getString(R.string.pref_camera_advanced_feature_default));
}
}
+
+ String chromaFlashOn = mActivity.getString(R.string
+ .pref_camera_advanced_feature_value_chromaflash_on);
+ if (notSame(pref, CameraSettings.KEY_SCENE_MODE, chromaFlashOn)) {
+ ListPreference lp = mPreferenceGroup
+ .findPreference(CameraSettings.KEY_ADVANCED_FEATURES);
+ if (lp != null && chromaFlashOn.equals(lp.getValue())) {
+ setPreference(CameraSettings.KEY_ADVANCED_FEATURES,
+ mActivity.getString(R.string.pref_camera_advanced_feature_default));
+ }
+ }
+
updateFilterModeIcon(pref, pref);
super.onSettingChanged(pref);
}
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 64896c4..b2e67ed 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1867,7 +1867,9 @@ public class PhotoModule
(fssr != null && fssr.equals(fssrOn)) ||
(truePortrait != null && truePortrait.equals(truPortraitOn)) ||
(stillMore != null && stillMore.equals(stillMoreOn))) {
- if (optiZoom != null && optiZoom.equals(optiZoomOn)) {
+ if ((optiZoom != null && optiZoom.equals(optiZoomOn)) ||
+ (CameraSettings.hasChromaFlashScene(mActivity) &&
+ chromaFlash != null && chromaFlash.equals(chromaFlashOn))) {
sceneMode = null;
} else {
mSceneMode = sceneMode = Parameters.SCENE_MODE_AUTO;
@@ -1891,7 +1893,9 @@ public class PhotoModule
// If scene mode is set, for white balance and focus mode
// read settings from preferences so we retain user preferences.
- if (!Parameters.SCENE_MODE_AUTO.equals(mSceneMode)) {
+ if (!Parameters.SCENE_MODE_AUTO.equals(mSceneMode) &&
+ !"asd".equals(mSceneMode) &&
+ !"sports".equals(mSceneMode)) {
flashMode = mParameters.FLASH_MODE_OFF;
String whiteBalance = Parameters.WHITE_BALANCE_AUTO;
focusMode = mFocusManager.getFocusMode(false);
@@ -1941,6 +1945,12 @@ public class PhotoModule
flashMode = Parameters.FLASH_MODE_OFF;
mParameters.setFlashMode(flashMode);
}
+
+ if (chromaFlash != null && chromaFlash.equals(chromaFlashOn)) {
+ flashMode = Parameters.FLASH_MODE_ON;
+ mParameters.setFlashMode(flashMode);
+ }
+
if (disableLongShot) {
mUI.overrideSettings(CameraSettings.KEY_LONGSHOT,
mActivity.getString(R.string.setting_off_value));
@@ -3692,6 +3702,8 @@ public class PhotoModule
.pref_camera_advanced_feature_value_refocus_on);
String optizoomOn = mActivity.getString(R.string
.pref_camera_advanced_feature_value_optizoom_on);
+ String chromaFlashOn = mActivity.getString(R.string
+ .pref_camera_advanced_feature_value_chromaflash_on);
if (CameraUtil.isSupported(mSceneMode, mParameters.getSupportedSceneModes())) {
if (!mParameters.getSceneMode().equals(mSceneMode)) {
@@ -3714,6 +3726,12 @@ public class PhotoModule
mUI.setPreference(CameraSettings.KEY_ADVANCED_FEATURES, optizoomOn);
} catch (NullPointerException e) {
}
+ } else if (chromaFlashOn.equals(mSceneMode)) {
+ try {
+ mUI.setPreference(CameraSettings.KEY_ADVANCED_FEATURES, chromaFlashOn);
+ mParameters.setSceneMode(Parameters.SCENE_MODE_AUTO);
+ } catch (NullPointerException e) {
+ }
} else {
mSceneMode = mParameters.getSceneMode();
if (mSceneMode == null) {
@@ -3748,7 +3766,9 @@ public class PhotoModule
Log.w(TAG, "invalid exposure range: " + value);
}
- if (Parameters.SCENE_MODE_AUTO.equals(mSceneMode)) {
+ if (Parameters.SCENE_MODE_AUTO.equals(mSceneMode) ||
+ "asd".equals(mSceneMode) ||
+ "sports".equals(mSceneMode)) {
// Set flash mode.
String flashMode;
if (mSavedFlashMode == null) {
@@ -3798,9 +3818,11 @@ public class PhotoModule
mActivity.getString(R.string.pref_camera_focustime_default))));
} else {
mFocusManager.overrideFocusMode(mParameters.getFocusMode());
- if (CameraUtil.isSupported(Parameters.FLASH_MODE_OFF,
+ String flashMode = chromaFlashOn.equals(mSceneMode) ?
+ Parameters.FLASH_MODE_ON : Parameters.FLASH_MODE_OFF;
+ if (CameraUtil.isSupported(flashMode,
mParameters.getSupportedFlashModes())) {
- mParameters.setFlashMode(Parameters.FLASH_MODE_OFF);
+ mParameters.setFlashMode(flashMode);
}
if (CameraUtil.isSupported(Parameters.WHITE_BALANCE_AUTO,
mParameters.getSupportedWhiteBalance())) {
@@ -4430,40 +4452,11 @@ public class PhotoModule
updateRemainingPhotos();
}
- if (CameraSettings.KEY_QC_CHROMA_FLASH.equals(pref.getKey())) {
+ if (!CameraSettings.hasChromaFlashScene(mActivity) &&
+ CameraSettings.KEY_QC_CHROMA_FLASH.equals(pref.getKey())) {
mUI.setPreference(CameraSettings.KEY_ADVANCED_FEATURES, pref.getValue());
}
- String ubiFocusOff = mActivity.getString(R.string.
- pref_camera_advanced_feature_value_ubifocus_off);
- String chromaFlashOff = mActivity.getString(R.string.
- pref_camera_advanced_feature_value_chromaflash_off);
- String optiZoomOff = mActivity.getString(R.string.
- pref_camera_advanced_feature_value_optizoom_off);
- String reFocusOff = mActivity.getString(R.string.
- pref_camera_advanced_feature_value_refocus_off);
- String fssrOff = mActivity.getString(R.string.
- pref_camera_advanced_feature_value_FSSR_off);
- String truePortraitOff = mActivity.getString(R.string.
- pref_camera_advanced_feature_value_trueportrait_off);
- String multiTouchFocusOff = mActivity.getString(R.string.
- pref_camera_advanced_feature_value_multi_touch_focus_off);
- String stillMoreOff = mActivity.getString(R.string.
- pref_camera_advanced_feature_value_stillmore_off);
- String advancedFeatureOff = mActivity.getString(R.string.
- pref_camera_advanced_feature_value_none);
- if (notSame(pref, CameraSettings.KEY_QC_OPTI_ZOOM, optiZoomOff) ||
- notSame(pref, CameraSettings.KEY_QC_CHROMA_FLASH, chromaFlashOff) ||
- notSame(pref, CameraSettings.KEY_QC_AF_BRACKETING, ubiFocusOff) ||
- notSame(pref, CameraSettings.KEY_QC_FSSR, fssrOff) ||
- notSame(pref, CameraSettings.KEY_QC_TP, truePortraitOff) ||
- notSame(pref, CameraSettings.KEY_QC_MULTI_TOUCH_FOCUS, multiTouchFocusOff) ||
- notSame(pref, CameraSettings.KEY_QC_STILL_MORE, stillMoreOff) ||
- notSame(pref, CameraSettings.KEY_QC_RE_FOCUS, reFocusOff) ||
- notSame(pref, CameraSettings.KEY_ADVANCED_FEATURES, advancedFeatureOff)) {
- RotateTextToast.makeText(mActivity, R.string.advanced_capture_disable_continuous_shot,
- Toast.LENGTH_LONG).show();
- }
//call generic onSharedPreferenceChanged
onSharedPreferenceChanged();
}