Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#constants) \| [Methods](https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#inhmethods)

# CameraExtensionCharacteristics

*** ** * ** ***


`
public

final

class
CameraExtensionCharacteristics
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.camera2.CameraExtensionCharacteristics |

<br />

*** ** * ** ***

<br />

Allows clients to query availability and supported resolutions of camera extensions.

Camera extensions give camera clients access to device-specific algorithms and sequences that
can improve the overall image quality of snapshots in various cases such as low light, selfies,
portraits, and scenes that can benefit from enhanced dynamic range. Often such sophisticated
processing sequences will rely on multiple camera frames as input and will produce a single
output.

Camera extensions are not guaranteed to be present on all devices so camera clients must
query for their availability via `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getSupportedExtensions()`.

In order to use any available camera extension, camera clients must create a corresponding
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession` via
`https://developer.android.com/reference/android/hardware/camera2/CameraDevice#createExtensionSession(android.hardware.camera2.params.ExtensionSessionConfiguration)`

Camera clients must be aware that device-specific camera extensions may support only a
subset of the available camera resolutions. Starting from API level 37.1, extensions may also
choose to not advertise any supported capture resolutions for still capture requests,
effectively not supporting still capture functionality. Clients must first query
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getExtensionSupportedSizes(int,%20int)` for supported
single high-quality request output sizes and
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getExtensionSupportedSizes(int,%20java.lang.Class<T>)` for supported
repeating request output sizes.

The extension characteristics for a given device are expected to remain static under
normal operating conditions.

<br />

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CameraManager#getCameraExtensionCharacteristics(java.lang.String)`

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` Device-specific extension implementation for automatic selection of particular extension such as HDR or NIGHT depending on the current lighting and environment conditions. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BEAUTY` *This constant was deprecated in API level 33. Use `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` instead.* |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` Device-specific extension implementation which can blur certain regions of the final image thereby "enhancing" focus for all remaining non-blurred parts. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` Device-specific extension implementation which tends to smooth the skin and apply other cosmetic effects to people's faces. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` Device-specific extension implementation for enhancing the dynamic range of the final image. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` Device-specific extension implementation that aims to suppress noise and improve the overall image quality under low light conditions. |

| ### Public methods ||
|---|---|
| ` <T> T` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#get(int,%20android.hardware.camera2.CameraCharacteristics.Key<T>)(int extension, https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key<T> key) ` Gets an extension specific camera characteristics field value. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key<T>>` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getAvailableCaptureRequestKeys(int)(int extension) ` Returns the set of keys supported by a `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest` submitted in a `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession` with a given extension type. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key<T>>` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getAvailableCaptureResultKeys(int)(int extension) ` Returns the set of keys supported by a `https://developer.android.com/reference/android/hardware/camera2/CaptureResult` passed as an argument to `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession.ExtensionCaptureCallback#onCaptureResultAvailable(android.hardware.camera2.CameraExtensionSession,%20android.hardware.camera2.CaptureRequest,%20android.hardware.camera2.TotalCaptureResult)`. |
| ` https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Long>` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getEstimatedCaptureLatencyRangeMillis(int,%20android.util.Size,%20int)(int extension, https://developer.android.com/reference/android/util/Size captureOutputSize, int format) ` Returns the estimated capture latency range in milliseconds for the target capture resolution during the calls to `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession#capture(android.hardware.camera2.CaptureRequest,%20java.util.concurrent.Executor,%20android.hardware.camera2.CameraExtensionSession.ExtensionCaptureCallback)`. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/util/Size>` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getExtensionSupportedSizes(int,%20int)(int extension, int format) ` Check whether a given extension is available and return the supported output surface resolutions that can be used for high-quality capture requests via `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession#capture(android.hardware.camera2.CaptureRequest,%20java.util.concurrent.Executor,%20android.hardware.camera2.CameraExtensionSession.ExtensionCaptureCallback)`. |
| ` <T> https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/util/Size>` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getExtensionSupportedSizes(int,%20java.lang.Class<T>)(int extension, https://developer.android.com/reference/java/lang/Class<T> klass) ` Get a list of sizes compatible with `klass` to use as an output for the repeating request `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession#setRepeatingRequest(android.hardware.camera2.CaptureRequest,%20java.util.concurrent.Executor,%20android.hardware.camera2.CameraExtensionSession.ExtensionCaptureCallback)`. |
| ` https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key<T>>` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getKeys(int)(int extension) ` Returns the `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics` keys that have extension-specific values. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/util/Size>` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getPostviewSupportedSizes(int,%20android.util.Size,%20int)(int extension, https://developer.android.com/reference/android/util/Size captureSize, int format) ` Get a list of the postview sizes supported for a still capture, using its capture size `captureSize`, to use as an output for the postview request. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/Integer>` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getSupportedExtensions()() ` Return a list of supported device-specific extensions for a given camera device. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#isCaptureProcessProgressAvailable(int)(int extension) ` Retrieve support for capture progress callbacks via `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession.ExtensionCaptureCallback#onCaptureProcessProgressed(android.hardware.camera2.CameraExtensionSession,%20android.hardware.camera2.CaptureRequest,%20int)`. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#isExtensionSupported(int)(int extensionType) ` Checks if a given camera extension is available for a specific camera device. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#isPostviewAvailable(int)(int extension) ` Checks for postview support of still capture. |

### Inherited methods

From class `

https://developer.android.com/reference/java/lang/Object

` `


https://developer.android.com/reference/java/lang/Object` `
https://developer.android.com/reference/java/lang/Object#clone()()
`

Creates and returns a copy of this object.


`


boolean` `
https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj)
`

Indicates whether some other object is "equal to" this one.


`


void` `
https://developer.android.com/reference/java/lang/Object#finalize()()
`

Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.


`


final

https://developer.android.com/reference/java/lang/Class<?>` `
https://developer.android.com/reference/java/lang/Object#getClass()()
`

Returns the runtime class of this `Object`.


`


int` `
https://developer.android.com/reference/java/lang/Object#hashCode()()
`

Returns a hash code value for the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notify()()
`

Wakes up a single thread that is waiting on this object's
monitor.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#notifyAll()()
`

Wakes up all threads that are waiting on this object's monitor.


`


https://developer.android.com/reference/java/lang/String` `
https://developer.android.com/reference/java/lang/Object#toString()()
`

Returns a string representation of the object.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis)
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*, or until a
certain amount of real time has elapsed.


`


final

void` `
https://developer.android.com/reference/java/lang/Object#wait()()
`

Causes the current thread to wait until it is awakened, typically
by being *notified* or *interrupted*.


## Constants

### EXTENSION_AUTOMATIC

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTENSION_AUTOMATIC
```

Device-specific extension implementation for automatic selection of particular extension
such as HDR or NIGHT depending on the current lighting and environment conditions.

<br />

Constant Value:

0
(0x00000000)


### EXTENSION_BEAUTY

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTENSION_BEAUTY
```


**This constant was deprecated
in API level 33.**   

Use `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` instead.

Device-specific extension implementation which tends to smooth the skin and apply other
cosmetic effects to people's faces.

<br />

Constant Value:

1
(0x00000001)


### EXTENSION_BOKEH

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTENSION_BOKEH
```

Device-specific extension implementation which can blur certain regions of the final image
thereby "enhancing" focus for all remaining non-blurred parts.

<br />

Constant Value:

2
(0x00000002)


### EXTENSION_FACE_RETOUCH

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTENSION_FACE_RETOUCH
```

Device-specific extension implementation which tends to smooth the skin and apply other
cosmetic effects to people's faces.

<br />

Constant Value:

1
(0x00000001)


### EXTENSION_HDR

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTENSION_HDR
```

Device-specific extension implementation for enhancing the dynamic range of the
final image.

<br />

Constant Value:

3
(0x00000003)


### EXTENSION_NIGHT

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int EXTENSION_NIGHT
```

Device-specific extension implementation that aims to suppress noise and improve the
overall image quality under low light conditions.

<br />

Constant Value:

4
(0x00000004)


## Public methods

### get

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public T get (int extension, 
                Key<T> key)
```

Gets an extension specific camera characteristics field value.

An extension can have a reduced set of camera capabilities (such as limited zoom ratio
range, available video stabilization modes, etc). This API enables applications to query for
an extension\\u2019s specific camera characteristics. Applications are recommended to prioritize
obtaining camera characteristics using this API when using an extension. A `null`
result indicates that the extension specific characteristic is not defined or available.

<br />

| Parameters ||
|---|---|
| `extension` | `int`: The extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |
| `key` | `Key`: The characteristics field to read. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `T` | The value of that key, or `null` if the field is not set. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if the key is not valid or extension type is not a supported device-specific extension. |

### getAvailableCaptureRequestKeys

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<CaptureRequest.Key<T>> getAvailableCaptureRequestKeys (int extension)
```

Returns the set of keys supported by a `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest` submitted in a
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession` with a given extension type.

The set returned is not modifiable, so any attempts to modify it will throw
a `UnsupportedOperationException`.

Devices launching on Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM`
or newer versions are required to support `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_AF_MODE`,
`https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_AF_REGIONS`, `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_AF_TRIGGER`,
`https://developer.android.com/reference/android/hardware/camera2/CaptureRequest#CONTROL_ZOOM_RATIO` for
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT`.

<br />

<br />

| Parameters ||
|---|---|
| `extension` | `int`: the extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key<T>>` | non-modifiable set of capture keys supported by camera extension session initialized with the given extension type. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | in case of unsupported extension. |

### getAvailableCaptureResultKeys

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<CaptureResult.Key<T>> getAvailableCaptureResultKeys (int extension)
```

Returns the set of keys supported by a `https://developer.android.com/reference/android/hardware/camera2/CaptureResult` passed as an argument to
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession.ExtensionCaptureCallback#onCaptureResultAvailable(android.hardware.camera2.CameraExtensionSession,%20android.hardware.camera2.CaptureRequest,%20android.hardware.camera2.TotalCaptureResult)`.

The set returned is not modifiable, so any attempts to modify it will throw
a `UnsupportedOperationException`.

In case the set is empty, then the extension is not able to support any capture results
and the `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession.ExtensionCaptureCallback#onCaptureResultAvailable(android.hardware.camera2.CameraExtensionSession,%20android.hardware.camera2.CaptureRequest,%20android.hardware.camera2.TotalCaptureResult)`
callback will not be fired.

Devices launching on Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM`
or newer versions are required to support `https://developer.android.com/reference/android/hardware/camera2/CaptureResult#CONTROL_AF_MODE`,
`https://developer.android.com/reference/android/hardware/camera2/CaptureResult#CONTROL_AF_REGIONS`, `https://developer.android.com/reference/android/hardware/camera2/CaptureResult#CONTROL_AF_TRIGGER`,
`https://developer.android.com/reference/android/hardware/camera2/CaptureResult#CONTROL_AF_STATE`, `https://developer.android.com/reference/android/hardware/camera2/CaptureResult#CONTROL_ZOOM_RATIO` for
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT`.

<br />

<br />

| Parameters ||
|---|---|
| `extension` | `int`: the extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key<T>>` | non-modifiable set of capture result keys supported by camera extension session initialized with the given extension type. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | in case of unsupported extension. |

### getEstimatedCaptureLatencyRangeMillis

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Range<Long> getEstimatedCaptureLatencyRangeMillis (int extension, 
                Size captureOutputSize, 
                int format)
```

Returns the estimated capture latency range in milliseconds for the
target capture resolution during the calls to `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession#capture(android.hardware.camera2.CaptureRequest,%20java.util.concurrent.Executor,%20android.hardware.camera2.CameraExtensionSession.ExtensionCaptureCallback)`. This
includes the time spent processing the multi-frame capture request along with any additional
time for encoding of the processed buffer if necessary.

<br />

| Parameters ||
|---|---|
| `extension` | `int`: the extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |
| `captureOutputSize` | `Size`: size of the capture output surface. If it is not in the supported output sizes, maximum capture output size is used for the estimation. This value cannot be `null`. <br /> |
| `format` | `int`: device-specific extension output format <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Range<https://developer.android.com/reference/java/lang/Long>` | the range of estimated minimal and maximal capture latency in milliseconds or null if no capture latency info can be provided <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | in case of format different from `https://developer.android.com/reference/android/graphics/ImageFormat#JPEG`, `https://developer.android.com/reference/android/graphics/ImageFormat#YUV_420_888`, `https://developer.android.com/reference/android/graphics/ImageFormat#JPEG_R` `https://developer.android.com/reference/android/graphics/ImageFormat#YCBCR_P010`, `https://developer.android.com/reference/android/graphics/ImageFormat#DEPTH_JPEG`; or unsupported extension. |

### getExtensionSupportedSizes

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Size> getExtensionSupportedSizes (int extension, 
                int format)
```

Check whether a given extension is available and return the
supported output surface resolutions that can be used for high-quality capture
requests via `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession#capture(android.hardware.camera2.CaptureRequest,%20java.util.concurrent.Executor,%20android.hardware.camera2.CameraExtensionSession.ExtensionCaptureCallback)`.

Note that device-specific extensions are allowed to support only a subset
of the camera resolutions advertised by
`https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)`.

Device-specific extensions currently support at most three
multi-frame capture surface formats. ImageFormat.JPEG, ImageFormat.YUV_420_888,
ImageFormat.JPEG_R, ImageFormat.YCBCR_P010 or ImageFormat.DEPTH_JPEG may or may not be
supported. Starting from API level 37.1, extensions that do not advertise any supported
capture resolutions do not support still capture functionality.

<br />

<br />

| Parameters ||
|---|---|
| `extension` | `int`: the extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |
| `format` | `int`: device-specific extension output format <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/util/Size>` | non-modifiable list of available sizes or an empty list if the format is not supported. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | in case of format different from ImageFormat.JPEG, ImageFormat.YUV_420_888, ImageFormat.JPEG_R, ImageFormat.DEPTH_JPEG, ImageFormat.YCBCR_P010; or unsupported extension. |

### getExtensionSupportedSizes

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Size> getExtensionSupportedSizes (int extension, 
                Class<T> klass)
```

Get a list of sizes compatible with `klass` to use as an output for the
repeating request
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession#setRepeatingRequest(android.hardware.camera2.CaptureRequest,%20java.util.concurrent.Executor,%20android.hardware.camera2.CameraExtensionSession.ExtensionCaptureCallback)`.

Note that device-specific extensions are allowed to support only a subset
of the camera output surfaces and resolutions.
The `https://developer.android.com/reference/android/graphics/SurfaceTexture` class is guaranteed at least one size for
backward compatible cameras whereas other output classes are not guaranteed to be supported.

Starting with Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#UPSIDE_DOWN_CAKE`
`https://developer.android.com/reference/android/view/SurfaceView` classes are also guaranteed to be supported and include
the same resolutions as `https://developer.android.com/reference/android/graphics/SurfaceTexture`.
Clients must set the desired SurfaceView resolution by calling
`https://developer.android.com/reference/android/view/SurfaceHolder#setFixedSize(int,%20int)`.

<br />

<br />

| Parameters ||
|---|---|
| `extension` | `int`: the extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |
| `klass` | `Class`: a non-`null` `https://developer.android.com/reference/java/lang/Class` object reference <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/util/Size>` | non-modifiable list of available sizes or an empty list if the Surface output is not supported. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | in case of unsupported extension. |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if `klass` was `null` |

### getKeys

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Set<CameraCharacteristics.Key<T>> getKeys (int extension)
```

Returns the `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics` keys that have extension-specific values.

An application can query the value from the key using
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#get(int,%20android.hardware.camera2.CameraCharacteristics.Key<T>)` API.

<br />

| Parameters ||
|---|---|
| `extension` | `int`: The extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/Set<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key<T>>` | An unmodifiable set of keys that are extension specific. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | in case the extension type is not a supported device-specific extension |

### getPostviewSupportedSizes

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Size> getPostviewSupportedSizes (int extension, 
                Size captureSize, 
                int format)
```

Get a list of the postview sizes supported for a still capture, using its
capture size `captureSize`, to use as an output for the postview request.

Available postview sizes will always be either equal to or less than the still
capture size. When choosing the most applicable postview size for a usecase, it should
be noted that lower resolution postviews will generally be available more quickly
than larger resolution postviews. For example, when choosing a size for an optimized
postview that will be displayed as a placeholder while the final image is processed,
the resolution closest to the preview size may be most suitable.

Note that device-specific extensions are allowed to support only a subset
of the camera resolutions advertised by
`https://developer.android.com/reference/android/hardware/camera2/params/StreamConfigurationMap#getOutputSizes(int)`.

<br />

<br />

| Parameters ||
|---|---|
| `extension` | `int`: the extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |
| `captureSize` | `Size`: size of the still capture for which the postview is requested. This value cannot be `null`. <br /> |
| `format` | `int`: device-specific extension output format of the postview <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/util/Size>` | non-modifiable list of available sizes or an empty list if the format and size is not supported. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | in case of unsupported extension or if postview feature is not supported by extension. |

### getSupportedExtensions

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public List<Integer> getSupportedExtensions ()
```

Return a list of supported device-specific extensions for a given camera device.

Do note that starting with `https://developer.android.com/reference/android/os/Build.VERSION_CODES#CINNAMON_BUN`
applications can use `https://developer.android.com/` to query for
public and device specific extension modes. The latter will not be included in the
list here.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/Integer>` | non-modifiable list of available extensions. This value cannot be `null`. <br /> |

### isCaptureProcessProgressAvailable

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isCaptureProcessProgressAvailable (int extension)
```

Retrieve support for capture progress callbacks via
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionSession.ExtensionCaptureCallback#onCaptureProcessProgressed(android.hardware.camera2.CameraExtensionSession,%20android.hardware.camera2.CaptureRequest,%20int)`.

<br />

| Parameters ||
|---|---|
| `extension` | `int`: the extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |

| Returns ||
|---|---|
| `boolean` | `true` in case progress callbacks are supported, `false` otherwise <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | in case of an unsupported extension. |

### isExtensionSupported

Added in [API level 37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isExtensionSupported (int extensionType)
```

Checks if a given camera extension is available for a specific camera device.

An extension may not be available on all devices. Even if a device supports extensions
in general, a specific extension might not be implemented for a particular camera ID.

In contrast to `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getSupportedExtensions()` this method can also be used to query
the available device specific extension modes.

<br />

<br />

| Parameters ||
|---|---|
| `extensionType` | `int`: The camera extension to query for. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |

| Returns ||
|---|---|
| `boolean` | `true` if the specified extension is supported for the given camera device, `false` otherwise. <br /> |

**See also:**

- `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC`
- `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH`
- `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH`
- `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR`
- `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT`

### isPostviewAvailable

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean isPostviewAvailable (int extension)
```

Checks for postview support of still capture.

A postview is a preview version of the still capture that is available before the final
image. For example, it can be used as a temporary placeholder for the requested capture
while the final image is being processed. The supported sizes for a still capture's postview
can be retrieved using
`https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#getPostviewSupportedSizes(int,%20android.util.Size,%20int)`.

Starting with Android `https://developer.android.com/reference/android/os/Build.VERSION_CODES#VANILLA_ICE_CREAM`,
the formats of the still capture and postview are not required to be equivalent upon capture
request.

<br />

<br />

| Parameters ||
|---|---|
| `extension` | `int`: the extension type. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_AUTOMATIC` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_FACE_RETOUCH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_BOKEH` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_HDR` - `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics#EXTENSION_NIGHT` |

| Returns ||
|---|---|
| `boolean` | `true` in case postview is supported, `false` otherwise <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | in case the extension type is not a supported device-specific extension |