/**
  * 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();
       }
     }
   }
 }
Beispiel #2
0
 /**
  * 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);
 }