@Override
      public void onOrientationChanged(int i) {
        if (i == ORIENTATION_UNKNOWN) {
          return;
        }
        int rotation = getWindowManager().getDefaultDisplay().getRotation();
        if (mCurrentRotation != rotation) {
          // Orientation changed, refresh camera.
          mCurrentRotation = rotation;
          if (mCameraSourcePreview != null) {
            mCameraSourcePreview.stop();
            mCameraSourcePreview.release();
          }
          createCameraSource();
          startCameraSource();
        }
      }
Activity for managing barcode capture.

The detected barcode value is returned as a result from this activity. If the app doesn't have
the camera permission, it will try to request the permission.
java/com/google/android/apps/authenticator/barcode/BarcodeCaptureActivity.java