@RequiresPermission(permission.CAMERA)
  private void startIfReady() {
    if (startRequested && surfaceAvailable) {
      try {
        cameraSource.start(surfaceView.getHolder());
        requestLayout();
      } catch (IOException e) {
        Log.e(TAG, "Could not start camera source", e);
        release();
      } catch (SecurityException e) {
        Log.e(TAG, "Do not have permission to start the camera", e);
      } catch (RuntimeException e) {
        // This should happen only during tests
        Log.e(TAG, "Runtime Exception!", e);
      }
      graphicOverlay.showContent();
      startRequested = false;
    }
  }
Check if we are is in the portrait mode or not

@return true if the we are currently in portrait mode
java/com/google/android/apps/authenticator/barcode/preview/CameraSourcePreview.java