@Test public void cameraInfo_canReturnLensFacing() throws CameraInfoUnavailableException { CameraInfo cameraInfo = new Camera2CameraInfo(mCameraManager, CAMERA0_ID); assertThat(cameraInfo.getLensFacing()).isEqualTo(CAMERA0_LENS_FACING_ENUM); }
@Nullable @Override public LensFacing getLensFacing() { Integer lensFacing = mCameraCharacteristics.get(CameraCharacteristics.LENS_FACING); Preconditions.checkNotNull(lensFacing); switch (lensFacing) { case CameraCharacteristics.LENS_FACING_FRONT: return LensFacing.FRONT; case CameraCharacteristics.LENS_FACING_BACK: return LensFacing.BACK; default: return null; } }
Camera2CameraInfo implements CameraInfo { @Nullable @Override public LensFacing getLensFacing() { Integer lensFacing = mCameraCharacteristics.get(CameraCharacteristics.LENS_FACING); Preconditions.checkNotNull(lensFacing); switch (lensFacing) { case CameraCharacteristics.LENS_FACING_FRONT: return LensFacing.FRONT; case CameraCharacteristics.LENS_FACING_BACK: return LensFacing.BACK; default: return null; } } }
Camera2CameraInfo implements CameraInfo { @Nullable @Override public LensFacing getLensFacing() { Integer lensFacing = mCameraCharacteristics.get(CameraCharacteristics.LENS_FACING); Preconditions.checkNotNull(lensFacing); switch (lensFacing) { case CameraCharacteristics.LENS_FACING_FRONT: return LensFacing.FRONT; case CameraCharacteristics.LENS_FACING_BACK: return LensFacing.BACK; default: return null; } } Camera2CameraInfo(CameraManager cameraManager, String cameraId); }
Camera2CameraInfo implements CameraInfo { @Nullable @Override public LensFacing getLensFacing() { Integer lensFacing = mCameraCharacteristics.get(CameraCharacteristics.LENS_FACING); Preconditions.checkNotNull(lensFacing); switch (lensFacing) { case CameraCharacteristics.LENS_FACING_FRONT: return LensFacing.FRONT; case CameraCharacteristics.LENS_FACING_BACK: return LensFacing.BACK; default: return null; } } Camera2CameraInfo(CameraManager cameraManager, String cameraId); @Nullable @Override LensFacing getLensFacing(); @Override int getSensorRotationDegrees(@RotationValue int relativeRotation); @Override int getSensorRotationDegrees(); }
Camera2CameraInfo implements CameraInfo { @Nullable @Override public LensFacing getLensFacing() { Integer lensFacing = mCameraCharacteristics.get(CameraCharacteristics.LENS_FACING); Preconditions.checkNotNull(lensFacing); switch (lensFacing) { case CameraCharacteristics.LENS_FACING_FRONT: return LensFacing.FRONT; case CameraCharacteristics.LENS_FACING_BACK: return LensFacing.BACK; default: return null; } } Camera2CameraInfo(CameraManager cameraManager, String cameraId); @Nullable @Override LensFacing getLensFacing(); @Override int getSensorRotationDegrees(@RotationValue int relativeRotation); @Override int getSensorRotationDegrees();  }