FlashState


public static class FlashState


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

The possible values are UNKNOWN, FIRED, UNAVAILABLE, and NOT_FIRED.

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

static final int
FIRED = 1

State indicating the flash was fired.

static final int

State indicating that flash has not been fired.

static final int

State indicating that flash is unavailable.

static final int

Unknown flash state.

Public fields

static @NonNull FlashState

Constants

FIRED

Added in 1.5.0-alpha06
public static final int FIRED = 1

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.

NOT_FIRED

Added in 1.5.0-alpha06
public static final int NOT_FIRED = 3

State indicating that flash has not been fired.

This is used when the flash is available but has not been fired.

UNAVAILABLE

Added in 1.5.0-alpha06
public static final int UNAVAILABLE = 2

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.

UNKNOWN

Added in 1.5.0-alpha06
public static final int UNKNOWN = 0

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.

Public fields

INSTANCE

Added in 1.5.0-alpha06
public static @NonNull FlashState INSTANCE

API reference packages and classes for Android app developers.

Updated Feb 13, 2025

API reference packages and classes for Android app developers.

Updated Feb 10, 2025

API reference packages and classes for Android app developers.

Updated Feb 10, 2025