summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2010-06-04 14:18:16 +0800
committerWu-cheng Li <wuchengli@google.com>2010-06-11 14:57:07 +0800
commit186ff08e71d106e329171055accd4395760495ea (patch)
treeb5cbb1574e2ee36c0516fc16852dc6c7458ed651 /src
parent1c3631accb0068a0a96cfd338820e6a7a61426f9 (diff)
downloadLegacyCamera-186ff08e71d106e329171055accd4395760495ea.zip
LegacyCamera-186ff08e71d106e329171055accd4395760495ea.tar.gz
LegacyCamera-186ff08e71d106e329171055accd4395760495ea.tar.bz2
Add metering mode support.
Change-Id: I8b964df4534da0b393479baddabfc85ce1b09b2f
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/Camera.java8
-rw-r--r--src/com/android/camera/CameraSettings.java7
-rw-r--r--src/com/android/camera/ui/CameraHeadUpDisplay.java3
3 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index 1f18dd6..c67f093 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -1871,6 +1871,14 @@ public class Camera extends NoSearchActivity implements View.OnClickListener,
} else {
mFocusMode = mParameters.getFocusMode();
}
+
+ // Set metering mode parameter.
+ String meteringMode = mPreferences.getString(
+ CameraSettings.KEY_METERING_MODE,
+ getString(R.string.pref_camera_meteringmode_default));
+ if (isSupported(meteringMode, mParameters.getSupportedMeteringModes())) {
+ mParameters.setMeteringMode(meteringMode);
+ }
}
// We separate the parameters into several subsets, so we can update only
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 5abe73c..b32f077 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -47,6 +47,7 @@ public class CameraSettings {
public static final String KEY_SCENE_MODE = "pref_camera_scenemode_key";
public static final String KEY_QUICK_CAPTURE = "pref_camera_quickcapture_key";
public static final String KEY_EXPOSURE = "pref_camera_exposure_key";
+ public static final String KEY_METERING_MODE = "pref_camera_meteringmode_key";
public static final String QUICK_CAPTURE_ON = "on";
public static final String QUICK_CAPTURE_OFF = "off";
@@ -139,6 +140,8 @@ public class CameraSettings {
ListPreference exposure = group.findPreference(KEY_EXPOSURE);
ListPreference videoFlashMode =
group.findPreference(KEY_VIDEOCAMERA_FLASH_MODE);
+ ListPreference meteringMode =
+ group.findPreference(KEY_METERING_MODE);
// Since the screen could be loaded from different resources, we need
// to check if the preference is available here
@@ -186,6 +189,10 @@ public class CameraSettings {
filterUnsupportedOptions(group,
videoFlashMode, mParameters.getSupportedFlashModes());
}
+ if (meteringMode != null) {
+ filterUnsupportedOptions(group,
+ meteringMode, mParameters.getSupportedMeteringModes());
+ }
if (exposure != null) {
buildExposureCompensation(group, exposure);
diff --git a/src/com/android/camera/ui/CameraHeadUpDisplay.java b/src/com/android/camera/ui/CameraHeadUpDisplay.java
index 9bdb68f..3b64faa 100644
--- a/src/com/android/camera/ui/CameraHeadUpDisplay.java
+++ b/src/com/android/camera/ui/CameraHeadUpDisplay.java
@@ -48,7 +48,8 @@ public class CameraHeadUpDisplay extends HeadUpDisplay {
CameraSettings.KEY_SCENE_MODE,
CameraSettings.KEY_PICTURE_SIZE,
CameraSettings.KEY_JPEG_QUALITY,
- CameraSettings.KEY_COLOR_EFFECT);
+ CameraSettings.KEY_COLOR_EFFECT,
+ CameraSettings.KEY_METERING_MODE);
mOtherSettings = new OtherSettingsIndicator(context, prefs);
mOtherSettings.setOnRestorePreferencesClickedRunner(new Runnable() {