# FakeCameraCharacteristics

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/FakeCameraCharacteristics.kt+class:androidx.camera.common.testing.FakeCameraCharacteristics) Added in [1.7.0-rc02](https://developer.android.com/jetpack/androidx/releases/camera#1.7.0-rc02)

*** ** * ** ***


```
class FakeCameraCharacteristics : CameraCharacteristicsWrapper
```

<br />

*** ** * ** ***

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

Allows mock values to be configured for camera characteristics, custom metadata, supported keys, and physical camera IDs. This class is designed to be used in unit tests to mock camera behavior without needing a physical device or a real camera service.

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If `physicalCameraIds` contains `cameraId`, or if any key in `restrictedKeys` or `sessionKeys` is not present in `cameraCharacteristics`. |

## Summary

| ### Public companion functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#create(kotlin.String,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.collections.Set,kotlin.collections.Set)( cameraId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/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<*>>, sessionKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>, sessionCaptureRequestKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<*>>, physicalCameraIds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html>, physicalCaptureRequestKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.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<*>> )` Creates a `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics` instance for Java compatibility. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#FakeCameraCharacteristics(androidx.camera.common.CameraId,kotlin.collections.Map,kotlin.collections.Map,kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set,kotlin.collections.Set,kotlin.Boolean,kotlin.collections.Set,kotlin.collections.Set)( cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId, 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<*>>, sessionKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<*>>, sessionCaptureRequestKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<*>>, physicalCameraIds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId>, physicalCaptureRequestKeys: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.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<*>> )` |

| ### 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/FakeCameraCharacteristics#get(android.hardware.camera2.CameraCharacteristics.Key)(key: https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<T>)` Retrieves the mock value for the specified `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`. |
| `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/FakeCameraCharacteristics#get(androidx.camera.common.Metadata.Key)(key: https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key<T>)` Retrieves the mock value for the specified `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`. |
| `open T?` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#unwrapAs(java.lang.Class)(type: https://developer.android.com/reference/java/lang/Class.html<T>)` Unwraps this instance to the requested type if compatible. |

| ### Public properties |
|---|---|
| `open https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#cameraId()` The `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` identifying this camera device. |
| `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/FakeCameraCharacteristics#captureRequestKeys()` The set of `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s supported by this camera. |
| `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/FakeCameraCharacteristics#captureResultKeys()` The set of `https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html`s supported by this camera. |
| `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/FakeCameraCharacteristics#dynamicKeys()` The set of `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s whose values can change depending on the device state. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#isRestricted()` Indicates whether the wrapper queried camera characteristics without camera permission. |
| `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/FakeCameraCharacteristics#keys()` A `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html` of all `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s supported by this camera device. |
| `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/FakeCameraCharacteristics#metadataKeys()` The set of all custom `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`s currently available in this container. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId>` | `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#physicalCameraIds()` The set of physical `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId`s that this logical camera device is made up of. |
| `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/FakeCameraCharacteristics#physicalCaptureRequestKeys()` The set of physical `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s. |
| `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/FakeCameraCharacteristics#restrictedKeys()` The set of `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s that require camera permissions. |
| `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/FakeCameraCharacteristics#sessionCaptureRequestKeys()` The set of `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s that the camera device can pass as part of the capture session initialization. |
| `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/FakeCameraCharacteristics#sessionKeys()` The set of `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s whose values are capture session specific. |

### Inherited functions

From [androidx.camera.common.CameraCharacteristicsMetadata](https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata) `open T` `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata#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 value of the specified `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`, or returns `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsMetadata#getOrDefault(android.hardware.camera2.CameraCharacteristics.Key,kotlin.Any)` if the value is `null` or the key is unsupported.
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,
    cameraCharacteristics: Map<CameraCharacteristics.Key<*>, Any?> = emptyMap(),
    cameraMetadata: Map<Metadata.Key<*>, Any?> = emptyMap(),
    captureRequestKeys: Set<CaptureRequest.Key<*>> = emptySet(),
    captureResultKeys: Set<CaptureResult.Key<*>> = emptySet(),
    sessionKeys: Set<CameraCharacteristics.Key<*>> = emptySet(),
    sessionCaptureRequestKeys: Set<CaptureRequest.Key<*>> = emptySet(),
    physicalCameraIds: Set<String> = emptySet(),
    physicalCaptureRequestKeys: Set<CaptureRequest.Key<*>> = emptySet(),
    isRestricted: Boolean = false,
    restrictedKeys: Set<CameraCharacteristics.Key<*>> = emptySet(),
    dynamicKeys: Set<CameraCharacteristics.Key<*>> = emptySet()
): FakeCameraCharacteristics
```

Creates a `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics` instance for Java compatibility.

| 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()`'s value. |
| `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 map of characteristics keys to their mock values. |
| `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 map of custom metadata keys to their mock values. |
| `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 set of capture request keys supported by this camera. |
| `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 set of capture result keys supported by this camera. |
| `sessionKeys: 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 set of session characteristics keys. All keys in this set must also be present in `cameraCharacteristics`. |
| `sessionCaptureRequestKeys: 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 set of session keys. |
| `physicalCameraIds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html> = emptySet()` | The set of physical camera ID strings. Must not contain `cameraId`. |
| `physicalCaptureRequestKeys: 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 set of physical capture request keys. |
| `isRestricted: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | True if the camera is operating in a restricted mode. |
| `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 set of keys that require camera permissions. All keys in this set must also be present in `cameraCharacteristics`. |
| `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 set of keys that can change dynamically. |

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

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | If `physicalCameraIds` contains `cameraId`, or if any key in `restrictedKeys` or `sessionKeys` is not present in `cameraCharacteristics`. |

## Public constructors

### FakeCameraCharacteristics

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

```
FakeCameraCharacteristics(
    cameraId: CameraId = FakeCameraIds.default,
    cameraCharacteristics: Map<CameraCharacteristics.Key<*>, Any?> = emptyMap(),
    cameraMetadata: Map<Metadata.Key<*>, Any?> = emptyMap(),
    captureRequestKeys: Set<CaptureRequest.Key<*>> = emptySet(),
    captureResultKeys: Set<CaptureResult.Key<*>> = emptySet(),
    sessionKeys: Set<CameraCharacteristics.Key<*>> = emptySet(),
    sessionCaptureRequestKeys: Set<CaptureRequest.Key<*>> = emptySet(),
    physicalCameraIds: Set<CameraId> = emptySet(),
    physicalCaptureRequestKeys: Set<CaptureRequest.Key<*>> = emptySet(),
    isRestricted: Boolean = false,
    restrictedKeys: Set<CameraCharacteristics.Key<*>> = emptySet(),
    dynamicKeys: Set<CameraCharacteristics.Key<*>> = emptySet()
)
```

| Parameters |
|---|---|
| `cameraId: https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId = FakeCameraIds.default` | The `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` identifying this camera device. Defaults to `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraIds#default()`. |
| `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()` | A map of `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html` to their mock values. Any key queried via `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#get(androidx.camera.common.Metadata.Key)` will return the value from this 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()` | A map of custom `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key` to their mock values. Any key queried via `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#get(androidx.camera.common.Metadata.Key)` will return the value from this 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 set of `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s supported by this camera. |
| `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 set of `https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html`s supported by this camera. |
| `sessionKeys: 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 set of `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s whose values are capture session specific. All keys in this set must also be present in `cameraCharacteristics`. |
| `sessionCaptureRequestKeys: 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 set of `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s that the camera device can pass as part of the capture session initialization. |
| `physicalCameraIds: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId> = emptySet()` | The set of physical `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId`s that this logical camera device is made up of. Must not contain `cameraId`. |
| `physicalCaptureRequestKeys: 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 set of physical `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s. |
| `isRestricted: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = false` | Indicates whether the wrapper queried camera characteristics without camera permission. |
| `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 set of `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s that require camera permissions. All keys in this set must also be present in `cameraCharacteristics`. |
| `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 set of `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s whose values can change depending on the device state. |

## 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 value for the specified `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`.

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

| Returns |
|---|---|
| `T?` | The mock value configured in `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#cameraCharacteristics()`, or `null` if not present. |

### 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 value for the specified `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`.

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

| Returns |
|---|---|
| `T?` | The mock value configured in `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics#cameraMetadata()`, or `null` if not present. |

### 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 to the requested type if compatible.

Since this is a fake implementation, it can only be unwrapped to `https://developer.android.com/reference/kotlin/androidx/camera/common/testing/FakeCameraCharacteristics` itself or its supertypes (e.g., `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraCharacteristicsWrapper`). It cannot be unwrapped to a native `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html`.

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

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

## Public properties

### cameraId

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

```
open val cameraId: CameraId
```

The `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId` identifying this camera device.

This corresponds to the camera ID used to open the camera with `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html#openCamera(java.lang.String, android.hardware.camera2.CameraDevice.StateCallback, android.os.Handler)`.

### 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 `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s supported by this camera.

### 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 `https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html`s supported by this camera.

### 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 `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s whose values can change depending on the device state.

### isRestricted

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

```
open val isRestricted: Boolean
```

Indicates whether the wrapper queried camera characteristics without camera permission.

### 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<*>>
```

A `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html` of all `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s supported by this camera device.

This property is equivalent to calling `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html#getKeys()` on the underlying camera characteristics, but may be cached for efficiency.

| See also |
|---|---|
| `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.html#getKeys()` |   |

### 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 set of all custom `https://developer.android.com/reference/kotlin/androidx/camera/common/Metadata.Key`s currently available in this container.

Note that this set contains *only* custom library-defined keys. It does not include platform-specific keys (such as `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html` or `https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html`), which are managed separately by the implementing wrappers.

### physicalCameraIds

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

```
open val physicalCameraIds: Set<CameraId>
```

The set of physical `https://developer.android.com/reference/kotlin/androidx/camera/common/CameraId`s that this logical camera device is made up of. Must not contain `cameraId`.

### physicalCaptureRequestKeys

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

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

The set of physical `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s.

### 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 `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s that require camera permissions. All keys in this set must also be present in `cameraCharacteristics`.

### sessionCaptureRequestKeys

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

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

The set of `https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html`s that the camera device can pass as part of the capture session initialization.

### sessionKeys

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

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

The set of `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s whose values are capture session specific. All keys in this set must also be present in `cameraCharacteristics`.