public synchronized void closeDriver() {
    if (camera != null) {
      camera.release();
      camera = null;

      // Make sure to clear these each time we close the camera, so that any scanning rect
      // requested by intent is forgotten.
      framingRect = null;
      framingRectInPreview = null;
    }
  }
Closes the camera driver if still in use.
OCRTest/src/main/java/edu/sfsu/cs/orange/ocr/camera/CameraManager.java