diff options
author | Ethan Chen <intervigil@gmail.com> | 2016-04-20 17:30:40 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-04-20 17:31:17 -0700 |
commit | f9739a380ecfb39a9c601c8dd47dbda89b21a470 (patch) | |
tree | e7ce307cc9faf048196835fc927e9bd30da5c847 /src/com/android/camera/PhotoModule.java | |
parent | c1945c87cd97fec45c4b6f65415ad170f0ce05e2 (diff) | |
download | android_packages_apps_Snap-f9739a380ecfb39a9c601c8dd47dbda89b21a470.tar.gz android_packages_apps_Snap-f9739a380ecfb39a9c601c8dd47dbda89b21a470.tar.bz2 android_packages_apps_Snap-f9739a380ecfb39a9c601c8dd47dbda89b21a470.zip |
Revert "Snap: Improve focusing"
This reverts commit 57799db3c1757618e00d331fe659ac4058624352.
Change-Id: I6027d853c9791a1b14c0dffcce038b450019735a
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 59 |
1 files changed, 14 insertions, 45 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 65f0d61a9..dc372a303 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -141,13 +141,11 @@ public class PhotoModule private static final int SWITCH_TO_GCAM_MODULE = 12; private static final int ON_PREVIEW_STARTED = 13; private static final int UPDATE_GESTURES_UI = 14; - private static final int SET_FOCUS_RATIO = 15; // The subset of parameters we need to update in setCameraParameters(). private static final int UPDATE_PARAM_INITIALIZE = 1; private static final int UPDATE_PARAM_ZOOM = 2; private static final int UPDATE_PARAM_PREFERENCE = 4; - private static final int UPDATE_PARAM_FOCUS = 8; private static final int UPDATE_PARAM_ALL = -1; // This is the delay before we execute onResume tasks when coming @@ -492,11 +490,6 @@ public class PhotoModule updateGesturesUI(); break; } - - case SET_FOCUS_RATIO: { - mUI.getFocusRing().setRadiusRatio((Float)msg.obj); - break; - } } } } @@ -942,14 +935,6 @@ public class PhotoModule } } - @Override - public void setFocusRatio(float ratio) { - mHandler.removeMessages(SET_FOCUS_RATIO); - Message m = mHandler.obtainMessage(SET_FOCUS_RATIO); - m.obj = ratio; - mHandler.sendMessage(m); - } - // TODO: need to check cached background apps memory and longshot ION memory private boolean isLongshotNeedCancel() { if (SECONDARY_SERVER_MEM == 0) { @@ -1465,8 +1450,6 @@ public class PhotoModule @Override public void onAutoFocusMoving( boolean moving, CameraProxy camera) { - mCameraDevice.refreshParameters(); - mFocusManager.setParameters(mCameraDevice.getParameters()); mFocusManager.onAutoFocusMoving(moving); } } @@ -1682,7 +1665,7 @@ public class PhotoModule @Override public void setFocusParameters() { - setCameraParameters(UPDATE_PARAM_FOCUS); + setCameraParameters(UPDATE_PARAM_PREFERENCE); } private Location getLocationAccordPictureFormat(String pictureFormat) { @@ -2541,7 +2524,7 @@ public class PhotoModule mCameraDevice.cancelAutoFocus(); setCameraState(IDLE); mFocusManager.setAeAwbLock(false); - setFocusParameters(); + setCameraParameters(UPDATE_PARAM_PREFERENCE); } } @@ -3438,7 +3421,7 @@ public class PhotoModule // initialize focus mode if ((mManual3AEnabled & MANUAL_FOCUS) == 0) { mFocusManager.overrideFocusMode(null); - updateCameraParametersFocus(); + mParameters.setFocusMode(mFocusManager.getFocusMode(false)); } // Set picture size. @@ -3667,33 +3650,25 @@ public class PhotoModule } } - enableAutoFocusMoveCallback(); - + if (mContinuousFocusSupported && ApiHelper.HAS_AUTO_FOCUS_MOVE_CALLBACK) { + updateAutoFocusMoveCallback(); + } //QCom related parameters updated here. qcomUpdateCameraParametersPreference(); return doGcamModeSwitch; } @TargetApi(Build.VERSION_CODES.JELLY_BEAN) - private void enableAutoFocusMoveCallback() { - if (mContinuousFocusSupported && ApiHelper.HAS_AUTO_FOCUS_MOVE_CALLBACK) { - if (mParameters.getFocusMode().equals(CameraUtil.FOCUS_MODE_CONTINUOUS_PICTURE)) { - mCameraDevice.setAutoFocusMoveCallback(mHandler, - (CameraAFMoveCallback) mAutoFocusMoveCallback); - } else { - mCameraDevice.setAutoFocusMoveCallback(null, null); - } + private void updateAutoFocusMoveCallback() { + if (mParameters.getFocusMode().equals(CameraUtil.FOCUS_MODE_CONTINUOUS_PICTURE) || + mParameters.getFocusMode().equals(CameraUtil.FOCUS_MODE_MW_CONTINUOUS_PICTURE)) { + mCameraDevice.setAutoFocusMoveCallback(mHandler, + (CameraAFMoveCallback) mAutoFocusMoveCallback); + } else { + mCameraDevice.setAutoFocusMoveCallback(null, null); } } - private void updateCameraParametersFocus() { - setAutoExposureLockIfSupported(); - setAutoWhiteBalanceLockIfSupported(); - setFocusAreasIfSupported(); - setMeteringAreasIfSupported(); - mParameters.setFocusMode(mFocusManager.getFocusMode(false)); - } - // We separate the parameters into several subsets, so we can update only // the subsets actually need updating. The PREFERENCE set needs extra // locking because the preference can be changed from GLThread as well. @@ -3716,14 +3691,8 @@ public class PhotoModule doModeSwitch = updateCameraParametersPreference(); } - if ((updateSet & UPDATE_PARAM_FOCUS) != 0) { - updateCameraParametersFocus(); - } - - mCameraDevice.setParameters(mParameters); - mParameters = mCameraDevice.getParameters(); - mFocusManager.setParameters(mParameters); CameraUtil.dumpParameters(mParameters); + mCameraDevice.setParameters(mParameters); // Switch to gcam module if HDR+ was selected if (doModeSwitch && !mIsImageCaptureIntent) { |