# 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)

*** ** * ** ***


```
public final class FakeCameraExtensionCharacteristics implements CameraExtensionCharacteristicsWrapper
```

<br />

*** ** * ** ***

A fake implementation of `https://developer.android.com/reference/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/androidx/camera/common/testing/FakeCameraExtensionCharacteristics.Companion#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/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

| ### Nested types |
|---|
| `public static class https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics.Companion` |

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` | `https://developer.android.com/reference/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)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html cameraId, int cameraExtension, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, https://developer.android.com/reference/java/lang/Object.html> cameraCharacteristics, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/Metadata.Key<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, https://developer.android.com/reference/java/lang/Object.html> cameraMetadata, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> captureRequestKeys, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> captureResultKeys, boolean isRestricted, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> restrictedKeys, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> dynamicKeys, boolean isPostviewSupported, boolean isCaptureProgressSupported, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>> outputSizesFormat, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>> outputSizesClass, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>> postviewSizes, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>, https://developer.android.com/reference/android/util/Range.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html>> latencies )` Creates a `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics` instance. |
| `T` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#get(android.hardware.camera2.CameraCharacteristics.Key)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> key)` Retrieves the mock characteristics value for the given key. |
| `T` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#get(androidx.camera.common.Metadata.Key)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/Metadata.Key<@https://developer.android.com/reference/androidx/annotation/NonNull T> key)` Retrieves the mock metadata value for the given key. |
| `int` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getCameraExtension()()` The camera extension mode represented by this characteristics instance. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getCameraId()()` The ID of the camera device associated with these extension characteristics. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getCaptureRequestKeys()()` The set of capture request keys supported by this camera extension. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getCaptureResultKeys()()` The set of capture result keys supported by this camera extension. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getDynamicKeys()()` The set of camera characteristics keys that are dynamically updated for this extension. |
| `https://developer.android.com/reference/android/util/Range.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getEstimatedCaptureLatencyRangeMillis(android.util.Size,kotlin.Int)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html captureSize, int imageFormat )` Returns the mock estimated capture latency range in milliseconds for the given capture size and format. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getKeys()()` The supported `https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html`s defined in the mock characteristics map. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/Metadata.Key<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getMetadataKeys()()` The supported `https://developer.android.com/reference/androidx/camera/common/Metadata.Key`s defined in the mock metadata map. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull T` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getOrDefault(android.hardware.camera2.CameraCharacteristics.Key,kotlin.Any)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> key, @https://developer.android.com/reference/androidx/annotation/NonNull T default )` Retrieves the mock characteristics value for the given key, returning the default if not set. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getOutputSizes(kotlin.Int)(int imageFormat)` Returns the mock output sizes for the given image format. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getOutputSizes(java.lang.Class)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> klass)` Returns the mock output sizes for the given output class. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getPostviewSizes(android.util.Size,kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html captureSize, int format)` Returns the mock postview sizes for the given capture size and format. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>>` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#getRestrictedKeys()()` The set of camera characteristics keys that require specific permissions to be accessed. |
| `boolean` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#isCaptureProgressSupported()()` Whether capture progress callbacks are supported for this extension mode. |
| `boolean` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#isPostviewSupported()()` Whether postview is supported for this extension mode. |
| `boolean` | `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#isRestricted()()` Whether access to some camera characteristics keys is restricted due to camera permissions. |
| `T` | `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraExtensionCharacteristics#unwrapAs(java.lang.Class)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> type)` Unwraps this instance as the requested type if compatible. |

### Inherited methods

From [androidx.camera.common.Metadata](https://developer.android.com/reference/androidx/camera/common/Metadata) `@https://developer.android.com/reference/androidx/annotation/NonNull T` `<T extends https://developer.android.com/reference/java/lang/Object.html> https://developer.android.com/reference/androidx/camera/common/Metadata#getOrDefault(androidx.camera.common.Metadata.Key,kotlin.Any)(
@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/Metadata.Key<@https://developer.android.com/reference/androidx/annotation/NonNull T> key,
@https://developer.android.com/reference/androidx/annotation/NonNull T default
)`

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

## Public methods

### create

```
public static final @NonNull FakeCameraExtensionCharacteristics create(
    @NonNull String cameraId,
    int cameraExtension,
    @NonNull Map<@NonNull CameraCharacteristics.Key<@NonNull ?>, Object> cameraCharacteristics,
    @NonNull Map<@NonNull Metadata.Key<@NonNull ?>, Object> cameraMetadata,
    @NonNull Set<@NonNull CaptureRequest.Key<@NonNull ?>> captureRequestKeys,
    @NonNull Set<@NonNull CaptureResult.Key<@NonNull ?>> captureResultKeys,
    boolean isRestricted,
    @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>> restrictedKeys,
    @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>> dynamicKeys,
    boolean isPostviewSupported,
    boolean isCaptureProgressSupported,
    @NonNull Map<@NonNull Integer, @NonNull Set<@NonNull Size>> outputSizesFormat,
    @NonNull Map<@NonNull Class<@NonNull ?>, @NonNull Set<@NonNull Size>> outputSizesClass,
    @NonNull Map<@NonNull Pair<@NonNull Size, @NonNull Integer>, @NonNull Set<@NonNull Size>> postviewSizes,
    @NonNull Map<@NonNull Pair<@NonNull Size, @NonNull Integer>, Range<@NonNull Long>> latencies
)
```

Creates a `https://developer.android.com/reference/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html cameraId` | the camera ID string (defaults to `https://developer.android.com/reference/androidx/camera/common/testing/FakeCameraIds#default()`). |
| `int cameraExtension` | 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 /> |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, https://developer.android.com/reference/java/lang/Object.html> cameraCharacteristics` | the mock characteristics map. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/Metadata.Key<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, https://developer.android.com/reference/java/lang/Object.html> cameraMetadata` | the mock metadata map. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CaptureRequest.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> captureRequestKeys` | the supported capture request keys. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CaptureResult.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> captureResultKeys` | the supported capture result keys. |
| `boolean isRestricted` | whether the extension is restricted. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> restrictedKeys` | the restricted characteristics keys. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> dynamicKeys` | the dynamic characteristics keys. |
| `boolean isPostviewSupported` | whether postview is supported. |
| `boolean isCaptureProgressSupported` | whether capture progress is supported. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>> outputSizesFormat` | mock output sizes map keyed by format. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>> outputSizesClass` | mock output sizes map keyed by class. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>> postviewSizes` | mock postview sizes map keyed by capture size and format. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Map.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html>, https://developer.android.com/reference/android/util/Range.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html>> latencies` | mock latencies map keyed by capture size and format. |

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

### get

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

```
public T <T extends Object> get(@NonNull CameraCharacteristics.Key<@NonNull T> key)
```

Retrieves the mock characteristics value for the given key.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics.Key.html<@https://developer.android.com/reference/androidx/annotation/NonNull T> key` | 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)

```
public T <T extends Object> get(@NonNull Metadata.Key<@NonNull T> key)
```

Retrieves the mock metadata value for the given key.

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

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

### getCameraExtension

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

```
public int getCameraExtension()
```

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`).

Value is one of the following:

- `2`
- `3`
- `4`
- `1`
- `0`

<br />

### getCameraId

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

```
public @NonNull CameraId getCameraId()
```

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

### getCaptureRequestKeys

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

```
public @NonNull Set<@NonNull CaptureRequest.Key<@NonNull ?>> getCaptureRequestKeys()
```

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

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

### getCaptureResultKeys

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

```
public @NonNull Set<@NonNull CaptureResult.Key<@NonNull ?>> getCaptureResultKeys()
```

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

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

### getDynamicKeys

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

```
public @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>> getDynamicKeys()
```

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

### getEstimatedCaptureLatencyRangeMillis

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

```
public Range<@NonNull Long> getEstimatedCaptureLatencyRangeMillis(
    @NonNull Size captureSize,
    int imageFormat
)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html captureSize` | the capture size. |
| `int imageFormat` | 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://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Long.html>` | the configured latency range, or null. |

### getKeys

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

```
public @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>> getKeys()
```

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

### getMetadataKeys

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

```
public @NonNull Set<@NonNull Metadata.Key<@NonNull ?>> getMetadataKeys()
```

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

### getOrDefault

```
public @NonNull T <T extends Object> getOrDefault(
    @NonNull CameraCharacteristics.Key<@NonNull T> key,
    @NonNull T default
)
```

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

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

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull 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)

```
public @NonNull Set<@NonNull Size> getOutputSizes(int imageFormat)
```

Returns the mock output sizes for the given image format.

| Parameters |
|---|---|
| `int imageFormat` | 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/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull 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)

```
public @NonNull Set<@NonNull Size> getOutputSizes(@NonNull Class<@NonNull ?> klass)
```

Returns the mock output sizes for the given output class.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> klass` | the output class. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull 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)

```
public @NonNull Set<@NonNull Size> getPostviewSizes(@NonNull Size captureSize, int format)
```

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html captureSize` | the capture size. |
| `int format` | 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/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Set.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/util/Size.html>` | the set of configured postview sizes. |

### getRestrictedKeys

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

```
public @NonNull Set<@NonNull CameraCharacteristics.Key<@NonNull ?>> getRestrictedKeys()
```

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

### isCaptureProgressSupported

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

```
public boolean isCaptureProgressSupported()
```

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)

```
public boolean isPostviewSupported()
```

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)

```
public boolean isRestricted()
```

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

If true, querying restricted keys via `https://developer.android.com/reference/androidx/camera/common/CameraCharacteristicsMetadata#get(android.hardware.camera2.CameraCharacteristics.Key)` or `https://developer.android.com/reference/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.

### unwrapAs

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

```
public T <T extends Object> unwrapAs(@NonNull Class<@NonNull T> type)
```

Unwraps this instance as the requested type if compatible.

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

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

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