# CameraExtensionCharacteristicsWrappers

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

*** ** * ** ***


```
public static class CameraExtensionCharacteristicsWrappers
```

<br />

*** ** * ** ***

Helper for constructing and loading `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances.

## Summary

| ### Public fields |
|---|---|
| `static @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrappers` | `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrappers#INSTANCE()` |

| ### Public methods |
|---|---|
| `static final @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/androidx/camera/common/CameraExtensionCharacteristicsWrapper>` | `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrappers#loadAvailableExtensionsFrom(android.hardware.camera2.CameraManager,androidx.camera.common.CameraId)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraManager.html cameraManager, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId )` Loads and wraps `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances for all supported extension modes on the given camera ID using the `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html`. |
| `static final @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/androidx/camera/common/CameraExtensionCharacteristicsWrapper>` | `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrappers#loadAvailableExtensionsFrom(android.content.Context,androidx.camera.common.CameraId)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId )` Loads and wraps `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances for all supported extension modes on the given camera ID using the `https://developer.android.com/reference/android/content/Context.html`. |
| `static final https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` | `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrappers#loadFrom(android.hardware.camera2.CameraManager,androidx.camera.common.CameraId,kotlin.Int)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraManager.html cameraManager, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId, int cameraExtension )` Loads and wraps `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for the given camera ID and extension mode using the `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html`. |
| `static final https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` | `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrappers#loadFrom(android.content.Context,androidx.camera.common.CameraId,kotlin.Int)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId, int cameraExtension )` Loads and wraps `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for the given camera ID and extension mode using the `https://developer.android.com/reference/android/content/Context.html`. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 31) https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrappers#wrap(androidx.camera.common.CameraId,kotlin.Int,android.hardware.camera2.CameraExtensionCharacteristics,kotlin.Boolean)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId, int cameraExtension, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html extensionCharacteristics, boolean isRestricted )` Wraps an existing `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` instance. |

## Public fields

### INSTANCE

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

```
public static @NonNull CameraExtensionCharacteristicsWrappers INSTANCE
```

## Public methods

### loadAvailableExtensionsFrom

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

```
public static final @NonNull Map<@NonNull Integer, @NonNull CameraExtensionCharacteristicsWrapper> loadAvailableExtensionsFrom(
    @NonNull CameraManager cameraManager,
    @NonNull CameraId cameraId
)
```

Loads and wraps `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances for all supported extension modes on the given camera ID using the `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html`.

Returns an empty map if the API level is less than 31.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraManager.html cameraManager` | the system camera manager. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId` | the ID of the camera device. |

| Returns |
|---|---|
| `@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/androidx/camera/common/CameraExtensionCharacteristicsWrapper>` | a map of `https://developer.android.com/reference/androidx/camera/common/CameraExtension` mode to `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper`. |

### loadAvailableExtensionsFrom

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

```
public static final @NonNull Map<@NonNull Integer, @NonNull CameraExtensionCharacteristicsWrapper> loadAvailableExtensionsFrom(
    @NonNull Context context,
    @NonNull CameraId cameraId
)
```

Loads and wraps `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instances for all supported extension modes on the given camera ID using the `https://developer.android.com/reference/android/content/Context.html`.

Returns an empty map if the API level is less than 31.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | the application context. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId` | the ID of the camera device. |

| Returns |
|---|---|
| `@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/androidx/camera/common/CameraExtensionCharacteristicsWrapper>` | a map of `https://developer.android.com/reference/androidx/camera/common/CameraExtension` mode to `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper`. |

### loadFrom

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

```
public static final CameraExtensionCharacteristicsWrapper loadFrom(
    @NonNull CameraManager cameraManager,
    @NonNull CameraId cameraId,
    int cameraExtension
)
```

Loads and wraps `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for the given camera ID and extension mode using the `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html`.

Returns `null` if the API level is less than 31 or if the extension is not supported by the camera device.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/hardware/camera2/CameraManager.html cameraManager` | the system camera manager. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId` | the ID of the camera device. |
| `int cameraExtension` | the camera extension mode. Value is one of the following: - `2` - `3` - `4` - `1` - `0` <br /> |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` | a `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instance, or null if unsupported. |

### loadFrom

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

```
public static final CameraExtensionCharacteristicsWrapper loadFrom(
    @NonNull Context context,
    @NonNull CameraId cameraId,
    int cameraExtension
)
```

Loads and wraps `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` for the given camera ID and extension mode using the `https://developer.android.com/reference/android/content/Context.html`.

Returns `null` if the API level is less than 31 or if the extension is not supported by the camera device.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context` | the application context. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId` | the ID of the camera device. |
| `int cameraExtension` | the camera extension mode. Value is one of the following: - `2` - `3` - `4` - `1` - `0` <br /> |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` | a `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instance, or null if unsupported. |

### wrap

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

```
@RequiresApi(value = 31)
public static final @NonNull CameraExtensionCharacteristicsWrapper wrap(
    @NonNull CameraId cameraId,
    int cameraExtension,
    @NonNull CameraExtensionCharacteristics extensionCharacteristics,
    boolean isRestricted
)
```

Wraps an existing `https://developer.android.com/reference/android/hardware/camera2/CameraExtensionCharacteristics.html` instance.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraId cameraId` | the ID of the camera device. |
| `int cameraExtension` | the camera extension mode. 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/android/hardware/camera2/CameraExtensionCharacteristics.html extensionCharacteristics` | the native camera extension characteristics instance. |
| `boolean isRestricted` | whether access to some characteristics keys is restricted. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` | a `https://developer.android.com/reference/androidx/camera/common/CameraExtensionCharacteristicsWrapper` instance wrapping the native object. |