# SessionConfigurationLegacy

Artifact: [androidx.camera.featurecombinationquery:featurecombinationquery](https://developer.android.com/jetpack/androidx/releases/camera-featurecombinationquery) [View Source](https://cs.android.com/search?q=file:androidx/camera/featurecombinationquery/SessionConfigurationLegacy.java+class:androidx.camera.featurecombinationquery.SessionConfigurationLegacy) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/camera-featurecombinationquery#1.5.0)

*** ** * ** ***

<br />

```
class SessionConfigurationLegacy
```

<br />

*** ** * ** ***

A compat class to store the same minimal information as Camera2's `https://developer.android.com/reference/android/hardware/camera2/params/SessionConfiguration.html`.

This class allows querying on devices that do not support Camera2's `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.CameraDeviceSetup.html` and need to query the camera capabilities before calling `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html#openCamera(java.lang.String, android.hardware.camera2.CameraDevice.StateCallback, android.os.Handler)`.

However, there are downsides to using the `*Legacy` classes.

1. When `*Legacy` classes are used, only the non-Camera2 databases (if present) will be queried.
2. The output of `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#createCaptureRequest(int)` will often set defaults based on the Template passed to it. Without the capture request provided by the camera2 API, there is no reasonable way for this API to guarantee that the result returned is completely reliable.

With those downsides, the usage of the `*Legacy` classes is restricted to devices that do not support `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.CameraDeviceSetup.html`. On devices that do not support `https://developer.android.com/reference/android/hardware/camera2/CameraDevice.CameraDeviceSetup.html`, it is strongly recommended that this class is used if and only if calling `https://developer.android.com/reference/android/hardware/camera2/CameraManager.html#openCamera(java.lang.String, android.hardware.camera2.CameraDevice.StateCallback, android.os.Handler)` is not possible before the query.

| See also |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/featurecombinationquery/CameraDeviceSetupCompat#isSessionConfigurationSupportedLegacy(androidx.camera.featurecombinationquery.SessionConfigurationLegacy)` |   |

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/camera/featurecombinationquery/SessionConfigurationLegacy.Builder` Simple builder class for `https://developer.android.com/reference/kotlin/androidx/camera/featurecombinationquery/SessionConfigurationLegacy`. |

| ### Public functions |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration.html!>` | `https://developer.android.com/reference/kotlin/androidx/camera/featurecombinationquery/SessionConfigurationLegacy#getOutputConfigurations()()` |
| `https://developer.android.com/reference/kotlin/androidx/camera/featurecombinationquery/SessionParametersLegacy` | `https://developer.android.com/reference/kotlin/androidx/camera/featurecombinationquery/SessionConfigurationLegacy#getSessionParameters()()` |

## Public functions

### getOutputConfigurations

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

```
fun getOutputConfigurations(): (Mutable)List<OutputConfiguration!>
```

| Returns |
|---|---|
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration.html!>` | the configured output configurations. |

### getSessionParameters

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

```
fun getSessionParameters(): SessionParametersLegacy
```

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/camera/featurecombinationquery/SessionParametersLegacy` | the associated session parameters. |