|
|
@ -823,6 +823,7 @@ class Camera1 extends CameraController implements Camera.PreviewCallback, Camera |
|
|
|
mCamera.setParameters(params); |
|
|
|
mCamera.setParameters(params); |
|
|
|
mCameraCallbacks.dispatchOnFocusStart(gesture, p); |
|
|
|
mCameraCallbacks.dispatchOnFocusStart(gesture, p); |
|
|
|
// TODO this is not guaranteed to be called... Fix.
|
|
|
|
// TODO this is not guaranteed to be called... Fix.
|
|
|
|
|
|
|
|
try { |
|
|
|
mCamera.autoFocus(new Camera.AutoFocusCallback() { |
|
|
|
mCamera.autoFocus(new Camera.AutoFocusCallback() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onAutoFocus(boolean success, Camera camera) { |
|
|
|
public void onAutoFocus(boolean success, Camera camera) { |
|
|
@ -832,6 +833,12 @@ class Camera1 extends CameraController implements Camera.PreviewCallback, Camera |
|
|
|
mHandler.get().postDelayed(mPostFocusResetRunnable, mPostFocusResetDelay); |
|
|
|
mHandler.get().postDelayed(mPostFocusResetRunnable, mPostFocusResetDelay); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} catch (RuntimeException e) { |
|
|
|
|
|
|
|
// Handling random auto-focus exception on some devices
|
|
|
|
|
|
|
|
// See https://github.com/natario1/CameraView/issues/181
|
|
|
|
|
|
|
|
LOG.e("startAutoFocus:", "Error calling autoFocus", e); |
|
|
|
|
|
|
|
mCameraCallbacks.dispatchOnFocusEnd(gesture, false, p); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|