summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWei-Ta Chen <weita@google.com>2011-09-16 12:06:54 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-16 12:06:54 -0700
commitefc7babaccbcf6feb690702127019a466a954c56 (patch)
tree1bd3e36725d5c024a49d411f895e6af14b9eb37d /src
parent496c17174e04a97ac605717a8ba62aa1b3f95b49 (diff)
parentd3105c578427ac7507ca32ff1de4a92962de2357 (diff)
downloadLegacyCamera-efc7babaccbcf6feb690702127019a466a954c56.zip
LegacyCamera-efc7babaccbcf6feb690702127019a466a954c56.tar.gz
LegacyCamera-efc7babaccbcf6feb690702127019a466a954c56.tar.bz2
Merge "Set the focus mode to infinity in the Panorama mode." into ics-factoryrom
Diffstat (limited to 'src')
-rw-r--r--src/com/android/camera/panorama/PanoramaActivity.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java
index 00613c7..d459740 100644
--- a/src/com/android/camera/panorama/PanoramaActivity.java
+++ b/src/com/android/camera/panorama/PanoramaActivity.java
@@ -164,6 +164,10 @@ public class PanoramaActivity extends Activity implements
private float[] mTransformMatrix;
private float mHorizontalViewAngle;
+ // Prefer FOCUS_MODE_INFINITY to FOCUS_MODE_CONTINUOUS_VIDEO because of
+ // getting a better image quality by the former.
+ private String mTargetFocusMode = Parameters.FOCUS_MODE_INFINITY;
+
private PanoOrientationEventListener mOrientationEventListener;
// The value could be 0, 1, 2, 3 for the 4 different orientations measured in clockwise
// respectively.
@@ -346,6 +350,15 @@ public class PanoramaActivity extends Activity implements
parameters.setPreviewFpsRange(minFps, maxFps);
Log.v(TAG, "preview fps: " + minFps + ", " + maxFps);
+ List<String> supportedFocusModes = parameters.getSupportedFocusModes();
+ if (supportedFocusModes.indexOf(mTargetFocusMode) >= 0) {
+ parameters.setFocusMode(mTargetFocusMode);
+ } else {
+ // Use the default focus mode and log a message
+ Log.w(TAG, "Cannot set the focus mode to " + mTargetFocusMode +
+ " becuase the mode is not supported.");
+ }
+
parameters.setRecordingHint(false);
mHorizontalViewAngle = ((mDeviceOrientation % 2) == 0) ?