public void closeCamera(){
  try {
    mCameraOpenCloseLock.acquire();
    if (null != mCameraDevice) {
      mCameraDevice.close();
      mCameraDevice=null;
      mCameraIsOpen=false;
    }
  }
 catch (  InterruptedException e) {
    throw new RuntimeException("Interrupted while trying to lock camera closing.");
  }
 finally {
    mCameraOpenCloseLock.release();
  }
}

public void closeCamera ( ) { try { mCameraOpenCloseLock . acquire ( ) ; if ( null != mCameraDevice ) { mCameraDevice . close ( ) ; mCameraDevice = null ; mCameraIsOpen = false ; } } catch ( InterruptedException e ) { throw new RuntimeException ( "Interrupted while trying to lock camera closing." ) ; } finally { mCameraOpenCloseLock . release ( ) ; } }
close camera when not in use / pausing / leaving
