@Test public void should_verifyThatFlashMode_isNotSupported() { when(mParameters.getSupportedFlashModes()) .thenReturn(Collections.singletonList(Camera.Parameters.FLASH_MODE_AUTO)); boolean isSupported = CameraParametersHelper.isFlashModeSupported( Camera.Parameters.FLASH_MODE_TORCH, mCamera); assertThat(isSupported).isFalse(); }
static boolean isFlashModeSupported(@NonNull String flashMode, @NonNull Camera camera) { List<String> supportedFlashModes = camera.getParameters().getSupportedFlashModes(); return supportedFlashModes != null && supportedFlashModes.contains(flashMode); }
CameraParametersHelper { static boolean isFlashModeSupported(@NonNull String flashMode, @NonNull Camera camera) { List<String> supportedFlashModes = camera.getParameters().getSupportedFlashModes(); return supportedFlashModes != null && supportedFlashModes.contains(flashMode); } }
CameraParametersHelper { static boolean isFlashModeSupported(@NonNull String flashMode, @NonNull Camera camera) { List<String> supportedFlashModes = camera.getParameters().getSupportedFlashModes(); return supportedFlashModes != null && supportedFlashModes.contains(flashMode); } private  CameraParametersHelper(); }
CameraParametersHelper { static boolean isFlashModeSupported(@NonNull String flashMode, @NonNull Camera camera) { List<String> supportedFlashModes = camera.getParameters().getSupportedFlashModes(); return supportedFlashModes != null && supportedFlashModes.contains(flashMode); } private  CameraParametersHelper();  }
CameraParametersHelper { static boolean isFlashModeSupported(@NonNull String flashMode, @NonNull Camera camera) { List<String> supportedFlashModes = camera.getParameters().getSupportedFlashModes(); return supportedFlashModes != null && supportedFlashModes.contains(flashMode); } private  CameraParametersHelper();   }