From 222b96c4063b1b8276a7c376d266cce207c2ad2e Mon Sep 17 00:00:00 2001 From: kaiyiz Date: Mon, 14 Jul 2014 15:51:30 +0800 Subject: Camera2: fix face still display after unmark the face detect option After unmark the face detect option, the value mFace in FaceView maybe reset value and draw all the time. The faces should not be draw after stopFaceDetection, so block draw the faces after stopFaceDetection and unblock after startFaceDetection. Change-Id: I2f8316e12ad8c7b157bc732800d9247c66a17572 CRs-Fixed: 692057 --- src/com/android/camera/PhotoModule.java | 2 +- src/com/android/camera/PhotoUI.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index cb76c56e9..31e5c87e7 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -820,7 +820,7 @@ public class PhotoModule mFaceDetectionStarted = false; mCameraDevice.setFaceDetectionCallback(null, null); mCameraDevice.stopFaceDetection(); - mUI.clearFaces(); + mUI.onStopFaceDetection(); } } diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 419cca22b..5a085dca5 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -920,6 +920,7 @@ public class PhotoUI implements PieListener, } public void onStartFaceDetection(int orientation, boolean mirror) { + mFaceView.setBlockDraw(false); mFaceView.clear(); mFaceView.setVisibility(View.VISIBLE); mFaceView.setDisplayOrientation(orientation); @@ -927,6 +928,13 @@ public class PhotoUI implements PieListener, mFaceView.resume(); } + public void onStopFaceDetection() { + if (mFaceView != null) { + mFaceView.setBlockDraw(true); + mFaceView.clear(); + } + } + @Override public void onFaceDetection(Face[] faces, CameraManager.CameraProxy camera) { mFaceView.setFaces(faces); -- cgit v1.2.3