summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoModule.java
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-07-07 14:25:12 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2014-07-07 14:25:12 -0700
commiteeb5e3156844c9e04697641597876a8e63775cc6 (patch)
treeeb6cae2c54e16b7742b4415c47709200846ac7c5 /src/com/android/camera/PhotoModule.java
parentef4d2a2a11595417bf078863b1689a80c904cc47 (diff)
parentde5dd90a48875ed84371da6eb4354826a3b429e2 (diff)
downloadandroid_packages_apps_Snap-eeb5e3156844c9e04697641597876a8e63775cc6.tar.gz
android_packages_apps_Snap-eeb5e3156844c9e04697641597876a8e63775cc6.tar.bz2
android_packages_apps_Snap-eeb5e3156844c9e04697641597876a8e63775cc6.zip
Merge "Camera: Initial Refocus support"
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rw-r--r--src/com/android/camera/PhotoModule.java41
1 files changed, 38 insertions, 3 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 456349826..9f0f3aefd 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -185,6 +185,7 @@ public class PhotoModule
private boolean mContinuousFocusSupported;
private boolean mTouchAfAecFlag;
private boolean mLongshotSave = false;
+ private boolean mRefocus = false;
// The degrees of the device rotated clockwise from its natural orientation.
private int mOrientation = OrientationEventListener.ORIENTATION_UNKNOWN;
@@ -1123,7 +1124,7 @@ public class PhotoModule
if (!mIsImageCaptureIntent) {
// Burst snapshot. Generate new image name.
if (mReceivedSnapNum > 1)
- mNamedImages.nameNewImage(mCaptureStartTime);
+ mNamedImages.nameNewImage(mCaptureStartTime, mRefocus);
// Calculate the width and the height of the jpeg.
Size s = mParameters.getPictureSize();
@@ -1326,6 +1327,13 @@ public class PhotoModule
mQueue.add(r);
}
+ public void nameNewImage(long date, boolean refocus) {
+ NamedEntity r = new NamedEntity();
+ r.title = CameraUtil.createJpegName(date, refocus);
+ r.date = date;
+ mQueue.add(r);
+ }
+
public NamedEntity getNextNameEntity() {
synchronized(mQueue) {
if (!mQueue.isEmpty()) {
@@ -1415,6 +1423,14 @@ public class PhotoModule
loc = mLocationManager.getCurrentLocation();
}
CameraUtil.setGpsParameters(mParameters, loc);
+
+ if (mRefocus) {
+ mParameters.set(CameraSettings.KEY_QC_LEGACY_BURST,
+ CameraSettings.KEY_QC_RE_FOCUS_COUNT);
+ } else {
+ mParameters.remove(CameraSettings.KEY_QC_LEGACY_BURST);
+ }
+
mCameraDevice.setParameters(mParameters);
mParameters = mCameraDevice.getParameters();
@@ -1452,7 +1468,7 @@ public class PhotoModule
setCameraState(SNAPSHOT_IN_PROGRESS);
}
- mNamedImages.nameNewImage(mCaptureStartTime);
+ mNamedImages.nameNewImage(mCaptureStartTime, mRefocus);
if (mSnapshotMode != CameraInfo.CAMERA_SUPPORT_MODE_ZSL) {
mFaceDetectionStarted = false;
@@ -2417,6 +2433,7 @@ public class PhotoModule
private void qcomUpdateAdvancedFeatures(String ubiFocus,
String chromaFlash,
+ String reFocus,
String optiZoom) {
if (CameraUtil.isSupported(ubiFocus,
CameraSettings.getSupportedAFBracketingModes(mParameters))) {
@@ -2430,6 +2447,10 @@ public class PhotoModule
CameraSettings.getSupportedOptiZoomModes(mParameters))) {
mParameters.set(CameraSettings.KEY_QC_OPTI_ZOOM, optiZoom);
}
+ if (CameraUtil.isSupported(reFocus,
+ CameraSettings.getSupportedRefocusModes(mParameters))) {
+ mParameters.set(CameraSettings.KEY_QC_RE_FOCUS, reFocus);
+ }
}
private void qcomUpdateCameraParametersPreference() {
//qcom Related Parameter update
@@ -2588,8 +2609,9 @@ public class PhotoModule
String advancedFeature = mPreferences.getString(
CameraSettings.KEY_ADVANCED_FEATURES,
mActivity.getString(R.string.pref_camera_advanced_feature_default));
- Log.v(TAG, " advancedFeature value =" + advancedFeature);
+ Log.e(TAG, " advancedFeature value =" + advancedFeature);
+ mRefocus = false;
if(advancedFeature != null) {
String ubiFocusOff = mActivity.getString(R.string.
pref_camera_advanced_feature_value_ubifocus_off);
@@ -2597,25 +2619,38 @@ public class PhotoModule
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);
if (advancedFeature.equals(mActivity.getString(R.string.
pref_camera_advanced_feature_value_ubifocus_on))) {
qcomUpdateAdvancedFeatures(advancedFeature,
chromaFlashOff,
+ reFocusOff,
optiZoomOff);
} else if (advancedFeature.equals(mActivity.getString(R.string.
pref_camera_advanced_feature_value_chromaflash_on))) {
qcomUpdateAdvancedFeatures(ubiFocusOff,
advancedFeature,
+ reFocusOff,
+ optiZoomOff);
+ } else if (advancedFeature.equals(mActivity.getString(R.string.
+ pref_camera_advanced_feature_value_refocus_on))) {
+ qcomUpdateAdvancedFeatures(ubiFocusOff,
+ chromaFlashOff,
+ advancedFeature,
optiZoomOff);
+ mRefocus = true;
} else if (advancedFeature.equals(mActivity.getString(R.string.
pref_camera_advanced_feature_value_optizoom_on))) {
qcomUpdateAdvancedFeatures(ubiFocusOff,
chromaFlashOff,
+ reFocusOff,
advancedFeature);
} else {
qcomUpdateAdvancedFeatures(ubiFocusOff,
chromaFlashOff,
+ reFocusOff,
optiZoomOff);
}
}