code: protected boolean closeCamera() {
  		if( verbose )
  			Log.i(TAG,"closeCamera() activity="+getClass().getSimpleName());
  		if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
  			throw new RuntimeException("Attempted to close camera not on the main looper thread!");
  		}
  
  		boolean closed = false;
  
  //		if( verbose ) {
  //			StackTraceElement[] trace = new RuntimeException().getStackTrace();
  //			for (int i = 0; i < Math.min(trace.length, 3); i++) {
  //				System.out.println("[ " + i + " ] = " + trace[i].toString());
  //			}
  //		}
  
  		// NOTE: Since open can only be called in the main looper this won't be enough to prevent
  		// it from closing before it opens. That's why open.state exists
  		open.mLock.lock();
  		try {
  			if( verbose )
  				Log.i(TAG,"closeCamera: camera="+(open.mCameraDevice==null)+" state="+open.state);
  			closePreviewSession();
  			// close has been called while trying to open the camera!
  			if( open.state == CameraState.OPENING ) {
  				// If it's in this state that means an asych task is opening the camera. By changing the state
  				// to closing it will not abort that process when the task is called.
  				open.state = CameraState.CLOSING;
  				if( open.mCameraDevice != null ) {
  					throw new RuntimeException("BUG! Camera is opening and should be null until opened");
  				}
  			} else {
  				if (null != open.mCameraDevice) {
  					closed = true;
  					open.closeCamera();
  				}
  				open.state = CameraState.CLOSED;
  				open.clearCamera();
  			}
  		} finally {
  			open.mLock.unlock();
  		}
  		return closed;
  	}
docs: Closes the camera. Returns true if the camera was not already closed and it closed it
  @return