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

```
public 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/androidx/camera/featurecombinationquery/CameraDeviceSetupCompat#isSessionConfigurationSupportedLegacy(androidx.camera.featurecombinationquery.SessionConfigurationLegacy)` |   |

## Summary

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

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/hardware/camera2/params/OutputConfiguration.html>` | `https://developer.android.com/reference/androidx/camera/featurecombinationquery/SessionConfigurationLegacy#getOutputConfigurations()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/camera/featurecombinationquery/SessionParametersLegacy` | `https://developer.android.com/reference/androidx/camera/featurecombinationquery/SessionConfigurationLegacy#getSessionParameters()()` |

## Public methods

### getOutputConfigurations

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

```
public @NonNull List<OutputConfiguration> getOutputConfigurations()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.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)

```
public @NonNull SessionParametersLegacy getSessionParameters()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/camera/featurecombinationquery/SessionParametersLegacy` | the associated session parameters. |