diff options
Diffstat (limited to 'src/com/android/camera/PhotoModule.java')
-rwxr-xr-x | src/com/android/camera/PhotoModule.java | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index 35bca15cc..08b0058e4 100755 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -741,7 +741,7 @@ public class PhotoModule Log.v(TAG, "onCameraOpened"); openCameraCommon(); resizeForPreviewAspectRatio(); - updateFocusManager(mUI); + mFocusManager.setFocusRing(mUI.getFocusRing()); } private void switchCamera() { @@ -765,7 +765,6 @@ public class PhotoModule } closeCamera(); mUI.collapseCameraControls(); - mUI.clearFaces(); if (mFocusManager != null) mFocusManager.removeMessages(); // Restart the camera and initialize the UI. From onCreate. @@ -1031,7 +1030,6 @@ public class PhotoModule if (mParameters.getMaxNumDetectedFaces() > 0) { mFaceDetectionStarted = false; mCameraDevice.setFaceDetectionCallback(null, null); - mUI.pauseFaceDetection(); mCameraDevice.stopFaceDetection(); mUI.onStopFaceDetection(); } @@ -1264,8 +1262,6 @@ public class PhotoModule return; } - mFocusManager.updateFocusUI(); // Ensure focus indicator is hidden. - String jpegFilePath = new String(jpegData); mNamedImages.nameNewImage(mCaptureStartTime); NamedEntity name = mNamedImages.getNextNameEntity(); @@ -1424,8 +1420,6 @@ public class PhotoModule mCameraDevice.setLongshot(false); } - mFocusManager.updateFocusUI(); // Ensure focus indicator is hidden. - boolean needRestartPreview = !mIsImageCaptureIntent && !mPreviewRestartSupport && (mCameraState != LONGSHOT) @@ -1475,7 +1469,6 @@ public class PhotoModule CameraUtil.FOCUS_MODE_MW_CONTINUOUS_PICTURE.equals(focusMode)) { mCameraDevice.cancelAutoFocus(); } - mUI.resumeFaceDetection(); if (!mIsImageCaptureIntent) { setCameraState(IDLE); } @@ -2817,28 +2810,12 @@ public class PhotoModule if (mFocusManager == null) { mFocusManager = new FocusOverlayManager(mPreferences, defaultFocusModes, mInitialParams, this, mMirror, - mActivity.getMainLooper(), mUI, mActivity); + mActivity.getMainLooper(), mUI != null ? mUI.getFocusRing() : null, mActivity); } } } } - private void updateFocusManager(PhotoUI mUI) { - // Idea here is to let focus manager create in camera open thread - // (in initializeFocusManager) even if photoUI is null by that time so - // as to not block start preview process. Once UI creation is done, - // we will update focus manager with proper UI. - if (mFocusManager != null && mUI != null) { - mFocusManager.setPhotoUI(mUI); - - View root = mUI.getRootView(); - // These depend on camera parameters. - int width = root.getWidth(); - int height = root.getHeight(); - mFocusManager.setPreviewSize(width, height); - } - } - @Override public void onConfigurationChanged(Configuration newConfig) { Log.v(TAG, "onConfigurationChanged"); @@ -2912,7 +2889,6 @@ public class PhotoModule } // Check if metering area or focus area is supported. if (!mFocusAreaSupported && !mMeteringAreaSupported) return; - if (! mFocusManager.getPreviewRect().contains(x, y)) return; mFocusManager.onSingleTapUp(x, y); } @@ -3806,7 +3782,7 @@ public class PhotoModule if(!mFocusManager.getFocusMode(false).equals(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE) && !mFocusManager.isFocusCompleted()) { - mUI.clearFocus(); + mUI.getFocusRing().stopFocusAnimations(); } String bokehMode = mPreferences.getString( |