/** * Convenience method for {@link com.google.zxing.client.android.CaptureActivity} * * @param newSetting if {@code true}, light should be turned on if currently off. And vice versa. */ public synchronized void setTorch(boolean newSetting) { if (newSetting != configManager.getTorchState(camera)) { if (camera != null) { if (autoFocusManager != null) { autoFocusManager.stop(); } configManager.setTorch(camera, newSetting); if (autoFocusManager != null) { autoFocusManager.start(); } } } }
/** Tells the camera to stop drawing preview frames. */ public synchronized void stopPreview() { if (autoFocusManager != null) { autoFocusManager.stop(); autoFocusManager = null; } if (camera != null && previewing) { camera.stopPreview(); previewCallback.setHandler(null, 0); previewing = false; } }
/** * Asks the camera hardware to perform an autofocus. * * @param delay Time delay to send with the request */ public synchronized void requestAutoFocus(long delay) { autoFocusManager.start(delay); }