Ejemplo n.º 1
0
 /** 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;
   }
 }
 /**
  * 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();
       }
     }
   }
 }