# FlashState

Artifact: [androidx.camera:camera-core](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/core/FlashState.kt+class:androidx.camera.core.FlashState) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/camera#1.5.0)

*** ** * ** ***

<br />

```
object FlashState
```

<br />

*** ** * ** ***

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

The possible values are `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState#UNKNOWN()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState#FIRED()`, `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState#UNAVAILABLE()`, and `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState#NOT_FIRED()`.

In case of any error, how it is notified depends on the API that is used for obtaining the `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState`. For example, if the flash state is obtained by invoking `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture#takePicture(java.util.concurrent.Executor,androidx.camera.core.ImageCapture.OnImageCapturedCallback)` and using the returned `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageProxy` to use `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageInfo#getFlashState()`, any related error will be notified via `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture.OnImageCapturedCallback#onError(androidx.camera.core.ImageCaptureException)`.

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState#FIRED() = 1` State indicating the flash was fired. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState#NOT_FIRED() = 3` State indicating that flash has not been fired. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState#UNAVAILABLE() = 2` State indicating that flash is unavailable. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState#UNKNOWN() = 0` Unknown flash state. |

## Constants

### FIRED

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/camera#1.5.0)

```
const val FIRED = 1: Int
```

State indicating the flash was fired.

This state will always be reported if an image is captured with `https://developer.android.com/reference/kotlin/androidx/camera/core/ImageCapture#FLASH_MODE_ON()` or `https://developer.android.com/reference/kotlin/androidx/camera/core/CameraControl#enableTorch(boolean)` is used. When `https://developer.android.com/reference/kotlin/androidx/camera/core/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.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState.FlashState` |   |

### NOT_FIRED

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/camera#1.5.0)

```
const val NOT_FIRED = 3: Int
```

State indicating that flash has not been fired.

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

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState.FlashState` |   |

### UNAVAILABLE

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/camera#1.5.0)

```
const val 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.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState.FlashState` |   |

### UNKNOWN

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/camera#1.5.0)

```
const val 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.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/core/FlashState.FlashState` |   |