FlashState


object FlashState


The camera flash state values represent the state of the physical flash unit of a camera.

The possible values are FLASH_STATE_UNKNOWN, FLASH_STATE_FIRED, FLASH_STATE_UNAVAILABLE, and FLASH_STATE_READY.

In case of any error, how it is notified depends on the API that is used for obtaining the FlashState. For example, if the flash state is obtained by invoking ImageCapture.takePicture(Executor, OnImageCapturedCallback) and using the returned ImageProxy to use ImageInfo.getFlashState, any related error will be notified via OnImageCapturedCallback.onError.

Summary

Constants

const Int

State indicating the flash was fired.

const Int

State indicating that flash is ready and can be fired if required.

const Int

State indicating that flash is unavailable.

const Int

Unknown flash state.

Constants

FLASH_STATE_FIRED

Added in 1.5.0-alpha05
const val FLASH_STATE_FIRED = 1: Int

State indicating the flash was fired.

This state will always be reported if an image is captured with ImageCapture.FLASH_MODE_ON or CameraControl.enableTorch is used. When ImageCapture.FLASH_MODE_AUTO is used, this state will be reported if the flash was actually triggered which depends on the lighting condition of the capture scene.

FLASH_STATE_READY

Added in 1.5.0-alpha05
const val FLASH_STATE_READY = 3: Int

State indicating that flash is ready and can be fired if required.

This is used when the flash is available to be fired but not fired yet.

FLASH_STATE_UNAVAILABLE

Added in 1.5.0-alpha05
const val FLASH_STATE_UNAVAILABLE = 2: Int

State indicating that flash is unavailable.

If a camera device does not include a physical flash unit or the physical flash is not available for usage, this state is used.

FLASH_STATE_UNKNOWN

Added in 1.5.0-alpha05
const val FLASH_STATE_UNKNOWN = 0: Int

Unknown flash state.

If a device does not report the flash state, this is used. For example, legacy camera devices don't report the flash state in certain conditions.