diff options
Diffstat (limited to 'src/com/android/camera/FocusOverlayManager.java')
-rw-r--r-- | src/com/android/camera/FocusOverlayManager.java | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/com/android/camera/FocusOverlayManager.java b/src/com/android/camera/FocusOverlayManager.java index f382a2ad6..9558944c0 100644 --- a/src/com/android/camera/FocusOverlayManager.java +++ b/src/com/android/camera/FocusOverlayManager.java @@ -63,12 +63,12 @@ public class FocusOverlayManager { private static final int RESET_TOUCH_FOCUS_DELAY = 3000; private int mState = STATE_IDLE; - private static final int STATE_IDLE = 0; // Focus is not active. - private static final int STATE_FOCUSING = 1; // Focus is in progress. + public static final int STATE_IDLE = 0; // Focus is not active. + public static final int STATE_FOCUSING = 1; // Focus is in progress. // Focus is in progress and the camera should take a picture after focus finishes. - private static final int STATE_FOCUSING_SNAP_ON_FINISH = 2; - private static final int STATE_SUCCESS = 3; // Focus finishes and succeeds. - private static final int STATE_FAIL = 4; // Focus finishes and fails. + public static final int STATE_FOCUSING_SNAP_ON_FINISH = 2; + public static final int STATE_SUCCESS = 3; // Focus finishes and succeeds. + public static final int STATE_FAIL = 4; // Focus finishes and fails. private boolean mInitialized; private boolean mFocusAreaSupported; @@ -90,6 +90,7 @@ public class FocusOverlayManager { Listener mListener; private boolean mPreviousMoving; private boolean mFocusDefault; + private boolean mZslEnabled = false; //QCom Parameter to disable focus for ZSL private FocusUI mUI; private final Rect mPreviewRect = new Rect(0, 0, 0, 0); @@ -201,7 +202,7 @@ public class FocusOverlayManager { } private void lockAeAwbIfNeeded() { - if (mLockAeAwbNeeded && !mAeAwbLock) { + if (mLockAeAwbNeeded && !mAeAwbLock && !mZslEnabled) { mAeAwbLock = true; mListener.setFocusParameters(); } @@ -520,6 +521,10 @@ public class FocusOverlayManager { // Put focus indicator to the center. clear reset position mUI.clearFocus(); // Initialize mFocusArea. + mFocusArea = null; + // Initialize mMeteringArea. + mMeteringArea = null; + if (mFocusAreaSupported) { initializeFocusAreas(mPreviewRect.centerX(), mPreviewRect.centerY()); } @@ -556,6 +561,10 @@ public class FocusOverlayManager { return mState == STATE_SUCCESS || mState == STATE_FAIL; } + public int getCurrentFocusState() { + return mState; + } + public boolean isFocusingSnapOnFinish() { return mState == STATE_FOCUSING_SNAP_ON_FINISH; } @@ -582,4 +591,12 @@ public class FocusOverlayManager { || focusMode.equals(Parameters.FOCUS_MODE_FIXED) || focusMode.equals(Parameters.FOCUS_MODE_EDOF)); } + + public void setZslEnable(boolean value) { + mZslEnabled = value; + } + + public boolean isZslEnabled() { + return mZslEnabled; + } } |