From 8060a409dcf06e68417d3dfa282d99e3fe64d26b Mon Sep 17 00:00:00 2001 From: muratgu Date: Tue, 28 Mar 2017 18:25:45 -0700 Subject: [PATCH] do not invoke auto-focus if not supported by the camera --- camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java b/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java index cc14b043..cb3e50f6 100644 --- a/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java +++ b/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java @@ -449,7 +449,9 @@ public class Camera1 extends CameraImpl { Camera.Parameters parameters = mCamera.getParameters(); if (parameters.getMaxNumMeteringAreas() > 0) { Rect rect = calculateFocusArea(event.getX(), event.getY()); - + if(!parameters.getSupportedFocusModes().contains(Camera.Parameters.FOCUS_MODE_AUTO)) { + return false; //cannot autoFocus + } parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); List meteringAreas = new ArrayList<>(); meteringAreas.add(new Camera.Area(rect, getFocusMeteringAreaWeight()));