From c5effbada57112445656bf4929f13f9942afb14c Mon Sep 17 00:00:00 2001 From: Erin Dahlgren Date: Thu, 7 Nov 2013 11:55:49 -0800 Subject: Fix photo mode is getting stuck in a single CameraState. Bug: 11574716 Change-Id: Ieb3622103798077071bb9350773851b7acbff756 --- src/com/android/camera/PhotoModule.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/com/android/camera/PhotoModule.java') diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index ce0deed54..347244ebe 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -350,7 +350,6 @@ public class PhotoModule } startPreview(); - mHandler.sendEmptyMessage(CAMERA_PREVIEW_DONE); break; } @@ -1566,12 +1565,8 @@ public class PhotoModule startPreview(); } + /** This can run on a background thread, post any view updates to MainHandler. */ private void startPreview() { - if (mCameraState != PREVIEW_STOPPED) { - Log.v(TAG, "Already previewing"); - return; - } - if (mPaused || mCameraDevice == null) { return; } @@ -1592,6 +1587,12 @@ public class PhotoModule return; } mCameraDevice.setErrorCallback(mErrorCallback); + // ICS camera frameworks has a bug. Face detection state is not cleared 1589 + // after taking a picture. Stop the preview to work around it. The bug + // was fixed in JB. + if (mCameraState != PREVIEW_STOPPED) { + stopPreview(); + } setDisplayOrientation(); @@ -1618,6 +1619,7 @@ public class PhotoModule if (mSnapshotOnIdle) { mHandler.post(mDoSnapRunnable); } + mHandler.sendEmptyMessage(CAMERA_PREVIEW_DONE); } } -- cgit v1.2.3