# FakeCameraExtensionCharacteristics

Artifact: [androidx.camera:camera-common-testing](https://developer.android.com/jetpack/androidx/releases/camera) [View Source](https://cs.android.com/search?q=file:androidx/camera/common/testing/FakeCameraExtensionCharacteristics.kt+class:androidx.camera.common.testing.FakeCameraExtensionCharacteristics) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

*** ** * ** ***


```
class FakeCameraExtensionCharacteristics : CameraExtensionCharacteristicsWrapper
```

<br />

*** ** * ** ***

A fake implementation of `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for testing.

This class allows unit tests to mock and configure the characteristics and capabilities of camera extension modes without relying on native Android platform classes or a physical device.

To instantiate this class:

- In **Kotlin** , use the companion `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#invoke(androidx.camera.common.CameraId,kotlin.Int,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.Boolean,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map)` operator for idiomatic builder-like creation: ``` ``kotlin val characteristics = FakeCameraExtensionCharacteristics( cameraId = CameraId("0"), cameraExtension = CameraExtensionCharacteristics.EXTENSION_BOKEH ) `` ```

- In **Java** , use the static `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#create(kotlin.String,kotlin.Int,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.Boolean,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map)` factory method which takes a raw `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` camera ID: ``` ``java FakeCameraExtensionCharacteristics characteristics = FakeCameraExtensionCharacteristics.create( "0", CameraExtensionCharacteristics.EXTENSION_BOKEH, // ... other parameters ); `` ```

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#create(kotlin.String,kotlin.Int,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.Boolean,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map)( cameraId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, cameraCharacteristics: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>, cameraMetadata: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>, captureRequestKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<*>>, captureResultKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html<*>>, isRestricted: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, restrictedKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>, dynamicKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>, isPostviewSupported: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, isCaptureProgressSupported: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, outputSizesFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>>, outputSizesClass: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/java/lang/Class.html<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>>, postviewSizes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://developer.android.com/reference/android/util/Size.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>>, latencies: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://developer.android.com/reference/android/util/Size.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>, https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>?> )` Creates a `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` instance. |
| `operator https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#invoke(androidx.camera.common.CameraId,kotlin.Int,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.Boolean,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Map)( cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId, cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, cameraCharacteristics: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>, cameraMetadata: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?>, captureRequestKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<*>>, captureResultKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html<*>>, isRestricted: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, restrictedKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>, dynamicKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>, isPostviewSupported: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, isCaptureProgressSupported: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, outputSizesFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>>, outputSizesClass: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/java/lang/Class.html<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>>, postviewSizes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://developer.android.com/reference/android/util/Size.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>>, latencies: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://developer.android.com/reference/android/util/Size.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>, https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>?> )` Creates a `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` instance. |

| ### Public functions |
|---|---|
| `open operator T?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#get(android.hardware.camera2.CameraCharacteristics.Key)(key: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<T>)` Retrieves the mock characteristics value for the given key. |
| `open operator T?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#get(androidx.camera.common.Metadata.Key)(key: https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<T>)` Retrieves the mock metadata value for the given key. |
| `open https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>?` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getEstimatedCaptureLatencyRangeMillis(android.util.Size,kotlin.Int)( captureSize: https://developer.android.com/reference/android/util/Size.html, imageFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` Returns the mock estimated capture latency range in milliseconds for the given capture size and format. |
| `open T` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getOrDefault(android.hardware.camera2.CameraCharacteristics.Key,kotlin.Any)(key: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<T>, default: T)` Retrieves the mock characteristics value for the given key, returning the default if not set. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getOutputSizes(kotlin.Int)(imageFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the mock output sizes for the given image format. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getOutputSizes(java.lang.Class)(klass: https://developer.android.com/reference/java/lang/Class.html<*>)` Returns the mock output sizes for the given output class. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getPostviewSizes(android.util.Size,kotlin.Int)(captureSize: https://developer.android.com/reference/android/util/Size.html, format: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the mock postview sizes for the given capture size and format. |
| `open T?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#unwrapAs(java.lang.Class)(type: https://developer.android.com/reference/java/lang/Class.html<T>)` Unwraps this instance as the requested type if compatible. |

| ### Public properties |
|---|---|
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#cameraExtension()` The camera extension mode represented by this characteristics instance. |
| `open https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#cameraId()` The ID of the camera device associated with these extension characteristics. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#captureRequestKeys()` The set of capture request keys supported by this camera extension. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#captureResultKeys()` The set of capture result keys supported by this camera extension. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#dynamicKeys()` The set of camera characteristics keys that are dynamically updated for this extension. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#isCaptureProgressSupported()` Whether capture progress callbacks are supported for this extension mode. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#isPostviewSupported()` Whether postview is supported for this extension mode. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#isRestricted()` Whether access to some camera characteristics keys is restricted due to camera permissions. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#keys()` The supported `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s defined in the mock characteristics map. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#metadataKeys()` The supported `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`s defined in the mock metadata map. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#restrictedKeys()` The set of camera characteristics keys that require specific permissions to be accessed. |

### Inherited functions

From [androidx.camera.common.Metadata](https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata) `open T` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata#getOrDefault(androidx.camera.common.Metadata.Key,kotlin.Any)(key: https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<T>, default: T)`

Retrieves the value associated with the specified `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`, or returns `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata#getOrDefault(androidx.camera.common.Metadata.Key,kotlin.Any)` if the key is not present.

## Public companion functions

### create

```
fun create(
    cameraId: String = FakeCameraIds.default.value,
    cameraExtension: Int = CameraExtensionCharacteristics.EXTENSION_AUTOMATIC,
    cameraCharacteristics: Map<CameraCharacteristics.Key<*>, Any?> = emptyMap(),
    cameraMetadata: Map<Metadata.Key<*>, Any?> = emptyMap(),
    captureRequestKeys: Set<CaptureRequest.Key<*>> = emptySet(),
    captureResultKeys: Set<CaptureResult.Key<*>> = emptySet(),
    isRestricted: Boolean = false,
    restrictedKeys: Set<CameraCharacteristics.Key<*>> = emptySet(),
    dynamicKeys: Set<CameraCharacteristics.Key<*>> = emptySet(),
    isPostviewSupported: Boolean = false,
    isCaptureProgressSupported: Boolean = false,
    outputSizesFormat: Map<Int, Set<Size>> = emptyMap(),
    outputSizesClass: Map<Class<*>, Set<Size>> = emptyMap(),
    postviewSizes: Map<Pair<Size, Int>, Set<Size>> = emptyMap(),
    latencies: Map<Pair<Size, Int>, Range<Long>?> = emptyMap()
): FakeCameraExtensionCharacteristics
```

Creates a `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` instance.

This method is designed for Java interop. It takes a raw string for the camera ID and supports default parameters in Java via `@JvmOverloads`.

| Parameters |
|---|---|
| `cameraId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html = FakeCameraIds.default.value` | the camera ID string (defaults to `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraIds#default()`). |
| `cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = CameraExtensionCharacteristics.EXTENSION_AUTOMATIC` | the extension mode (defaults to `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_AUTOMATIC`). Value is one of the following: - `2` - `3` - `4` - `1` - `0` <br /> |
| `cameraCharacteristics: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> = emptyMap()` | the mock characteristics map. |
| `cameraMetadata: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> = emptyMap()` | the mock metadata map. |
| `captureRequestKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<*>> = emptySet()` | the supported capture request keys. |
| `captureResultKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html<*>> = emptySet()` | the supported capture result keys. |
| `isRestricted: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | whether the extension is restricted. |
| `restrictedKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>> = emptySet()` | the restricted characteristics keys. |
| `dynamicKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>> = emptySet()` | the dynamic characteristics keys. |
| `isPostviewSupported: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | whether postview is supported. |
| `isCaptureProgressSupported: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | whether capture progress is supported. |
| `outputSizesFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>> = emptyMap()` | mock output sizes map keyed by format. |
| `outputSizesClass: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/java/lang/Class.html<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>> = emptyMap()` | mock output sizes map keyed by class. |
| `postviewSizes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://developer.android.com/reference/android/util/Size.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>> = emptyMap()` | mock postview sizes map keyed by capture size and format. |
| `latencies: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://developer.android.com/reference/android/util/Size.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>, https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>?> = emptyMap()` | mock latencies map keyed by capture size and format. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` | a configured `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` instance. |

### invoke

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

```
operator fun invoke(
    cameraId: CameraId = FakeCameraIds.default,
    cameraExtension: Int = CameraExtensionCharacteristics.EXTENSION_AUTOMATIC,
    cameraCharacteristics: Map<CameraCharacteristics.Key<*>, Any?> = emptyMap(),
    cameraMetadata: Map<Metadata.Key<*>, Any?> = emptyMap(),
    captureRequestKeys: Set<CaptureRequest.Key<*>> = emptySet(),
    captureResultKeys: Set<CaptureResult.Key<*>> = emptySet(),
    isRestricted: Boolean = false,
    restrictedKeys: Set<CameraCharacteristics.Key<*>> = emptySet(),
    dynamicKeys: Set<CameraCharacteristics.Key<*>> = emptySet(),
    isPostviewSupported: Boolean = false,
    isCaptureProgressSupported: Boolean = false,
    outputSizesFormat: Map<Int, Set<Size>> = emptyMap(),
    outputSizesClass: Map<Class<*>, Set<Size>> = emptyMap(),
    postviewSizes: Map<Pair<Size, Int>, Set<Size>> = emptyMap(),
    latencies: Map<Pair<Size, Int>, Range<Long>?> = emptyMap()
): FakeCameraExtensionCharacteristics
```

Creates a `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` instance.

This operator is designed for Kotlin usage. It supports the type-safe `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` value class and default arguments.

| Parameters |
|---|---|
| `cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId = FakeCameraIds.default` | the camera ID (defaults to `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraIds#default()`). |
| `cameraExtension: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html = CameraExtensionCharacteristics.EXTENSION_AUTOMATIC` | the extension mode (defaults to `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_AUTOMATIC`). Value is one of the following: - `2` - `3` - `4` - `1` - `0` <br /> |
| `cameraCharacteristics: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> = emptyMap()` | the mock characteristics map. |
| `cameraMetadata: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> = emptyMap()` | the mock metadata map. |
| `captureRequestKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<*>> = emptySet()` | the supported capture request keys. |
| `captureResultKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html<*>> = emptySet()` | the supported capture result keys. |
| `isRestricted: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | whether the extension is restricted. |
| `restrictedKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>> = emptySet()` | the restricted characteristics keys. |
| `dynamicKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>> = emptySet()` | the dynamic characteristics keys. |
| `isPostviewSupported: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | whether postview is supported. |
| `isCaptureProgressSupported: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | whether capture progress is supported. |
| `outputSizesFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>> = emptyMap()` | mock output sizes map keyed by format. |
| `outputSizesClass: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://developer.android.com/reference/java/lang/Class.html<*>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>> = emptyMap()` | mock output sizes map keyed by class. |
| `postviewSizes: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://developer.android.com/reference/android/util/Size.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>> = emptyMap()` | mock postview sizes map keyed by capture size and format. |
| `latencies: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<https://developer.android.com/reference/android/util/Size.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html>, https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>?> = emptyMap()` | mock latencies map keyed by capture size and format. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` | a configured `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` instance. |

## Public functions

### get

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

```
open operator fun <T : Any> get(key: CameraCharacteristics.Key<T>): T?
```

Retrieves the mock characteristics value for the given key.

| Parameters |
|---|---|
| `key: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<T>` | the characteristics key. |

| Returns |
|---|---|
| `T?` | the mock value, or null if not set. |

### get

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

```
open operator fun <T : Any> get(key: Metadata.Key<T>): T?
```

Retrieves the mock metadata value for the given key.

| Parameters |
|---|---|
| `key: https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<T>` | the metadata key. |

| Returns |
|---|---|
| `T?` | the mock value, or null if not set. |

### getEstimatedCaptureLatencyRangeMillis

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

```
open fun getEstimatedCaptureLatencyRangeMillis(
    captureSize: Size,
    imageFormat: Int
): Range<Long>?
```

Returns the mock estimated capture latency range in milliseconds for the given capture size and format.

| Parameters |
|---|---|
| `captureSize: https://developer.android.com/reference/android/util/Size.html` | the capture size. |
| `imageFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the image format. Value is one of the following: - `0` - `4` - `842094169` - `538982489` - `16` - `17` - `20` - `256` - `1768253795` - `35` - `39` - `40` - `41` - `42` - `32` - `36` - `37` - `38` - `1144402265` - `257` - `34` - `1212500294` - `54` - `4101` - `4098` - `4099` - `540422489` - `60` - `4102` - `56` - `55` - `57` - `58` - `59` - `-3` - `-2` - `-1` - `1` - `2` - `3` - `22` - `43` - `33` - `48` - `49` - `50` - `51` - `52` - `53` <br /> |

| Returns |
|---|---|
| `https://developer.android.com/reference/android/util/Range.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html>?` | the configured latency range, or null. |

### getOrDefault

```
open fun <T : Any> getOrDefault(key: CameraCharacteristics.Key<T>, default: T): T
```

Retrieves the mock characteristics value for the given key, returning the default if not set.

| Parameters |
|---|---|
| `key: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<T>` | the characteristics key. |
| `default: T` | the default value to return if the key is not set. |

| Returns |
|---|---|
| `T` | the mock value, or the default value. |

### getOutputSizes

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

```
open fun getOutputSizes(imageFormat: Int): Set<Size>
```

Returns the mock output sizes for the given image format.

| Parameters |
|---|---|
| `imageFormat: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the image format. Value is one of the following: - `0` - `4` - `842094169` - `538982489` - `16` - `17` - `20` - `256` - `1768253795` - `35` - `39` - `40` - `41` - `42` - `32` - `36` - `37` - `38` - `1144402265` - `257` - `34` - `1212500294` - `54` - `4101` - `4098` - `4099` - `540422489` - `60` - `4102` - `56` - `55` - `57` - `58` - `59` - `-3` - `-2` - `-1` - `1` - `2` - `3` - `22` - `43` - `33` - `48` - `49` - `50` - `51` - `52` - `53` <br /> |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | the set of configured output sizes. |

### getOutputSizes

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

```
open fun getOutputSizes(klass: Class<*>): Set<Size>
```

Returns the mock output sizes for the given output class.

| Parameters |
|---|---|
| `klass: https://developer.android.com/reference/java/lang/Class.html<*>` | the output class. |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | the set of configured output sizes. |

### getPostviewSizes

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

```
open fun getPostviewSizes(captureSize: Size, format: Int): Set<Size>
```

Returns the mock postview sizes for the given capture size and format.

| Parameters |
|---|---|
| `captureSize: https://developer.android.com/reference/android/util/Size.html` | the capture size. |
| `format: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the image format. Value is one of the following: - `0` - `4` - `842094169` - `538982489` - `16` - `17` - `20` - `256` - `1768253795` - `35` - `39` - `40` - `41` - `42` - `32` - `36` - `37` - `38` - `1144402265` - `257` - `34` - `1212500294` - `54` - `4101` - `4098` - `4099` - `540422489` - `60` - `4102` - `56` - `55` - `57` - `58` - `59` - `-3` - `-2` - `-1` - `1` - `2` - `3` - `22` - `43` - `33` - `48` - `49` - `50` - `51` - `52` - `53` <br /> |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/util/Size.html>` | the set of configured postview sizes. |

### unwrapAs

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

```
open fun <T : Any> unwrapAs(type: Class<T>): T?
```

Unwraps this instance as the requested type if compatible.

Implements `https://developer.android.com/reference/kotlin/androidx/camera/common/UnsafeWrapper#unwrapAs(java.lang.Class)`.

| Parameters |
|---|---|
| `type: https://developer.android.com/reference/java/lang/Class.html<T>` | the class of the expected type. |

| Returns |
|---|---|
| `T?` | this instance cast to `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#unwrapAs(java.lang.Class)` if compatible, or null. |

## Public properties

### cameraExtension

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

```
open val cameraExtension: Int
```

The camera extension mode represented by this characteristics instance.

Value is one of the native camera extension constants defined in `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` (e.g., `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_BOKEH`, `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_HDR`, `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_NIGHT`, `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_FACE_RETOUCH`, or `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html#EXTENSION_AUTOMATIC`).

### cameraId

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

```
open val cameraId: CameraId
```

The ID of the camera device associated with these extension characteristics.

### captureRequestKeys

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

```
open val captureRequestKeys: Set<CaptureRequest.Key<*>>
```

The set of capture request keys supported by this camera extension.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #getAvailableCaptureRequestKeys |

### captureResultKeys

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

```
open val captureResultKeys: Set<CaptureResult.Key<*>>
```

The set of capture result keys supported by this camera extension.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #getAvailableCaptureResultKeys |

### dynamicKeys

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

```
open val dynamicKeys: Set<CameraCharacteristics.Key<*>>
```

The set of camera characteristics keys that are dynamically updated for this extension.

### isCaptureProgressSupported

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

```
open val isCaptureProgressSupported: Boolean
```

Whether capture progress callbacks are supported for this extension mode.

If true, capture requests can report progress updates during the extension processing.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #isCaptureProcessProgressSupported |

### isPostviewSupported

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

```
open val isPostviewSupported: Boolean
```

Whether postview is supported for this extension mode.

A postview is a quickly available, lower-resolution preview of the captured image that can be displayed while the final high-quality capture is processing.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` | #isPostviewSupported |

### isRestricted

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

```
open val isRestricted: Boolean
```

Whether access to some camera characteristics keys is restricted due to camera permissions.

If true, querying restricted keys via `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata#get(android.hardware.camera2.CameraCharacteristics.Key)` or `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata#getOrDefault(android.hardware.camera2.CameraCharacteristics.Key,kotlin.Any)` may return null or default values, matching the behavior of restricted extension modes when CAMERA permission is not granted.

### keys

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

```
open val keys: Set<CameraCharacteristics.Key<*>>
```

The supported `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s defined in the mock characteristics map.

### metadataKeys

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

```
open val metadataKeys: Set<Metadata.Key<*>>
```

The supported `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`s defined in the mock metadata map.

### restrictedKeys

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

```
open val restrictedKeys: Set<CameraCharacteristics.Key<*>>
```

The set of camera characteristics keys that require specific permissions to be accessed.