# SandboxedUiAdapter.Session

Artifact: [androidx.privacysandbox.ui:ui-core](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/ui/core/SandboxedUiAdapter.kt+class:androidx.privacysandbox.ui.core.SandboxedUiAdapter.Session) Added in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17) Deprecated in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17)

*** ** * ** ***


```
public interface SandboxedUiAdapter.Session extends AutoCloseable
```

<br />

Known direct subclasses [AbstractSandboxedUiAdapter.AbstractSession](https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter.AbstractSession)

|---|---|
| `https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter.AbstractSession` | **This class is deprecated.** This library is no longer supported. |

*** ** * ** ***

> [!CAUTION]
> **This interface is deprecated.**   
> This library is no longer supported.

A single session with the provider of remote content.

## Summary

| ### Public methods |
|---|---|
| `abstract void` | `[close](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#close())()` **This method is deprecated.** This library is no longer supported. |
| `abstract @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/java/lang/String.html>` | `[getSignalOptions](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#getSignalOptions())()` **This method is deprecated.** This library is no longer supported. |
| `abstract @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/view/View.html` | `[getView](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#getView())()` **This method is deprecated.** This library is no longer supported. |
| `abstract void` | `[notifyConfigurationChanged](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyConfigurationChanged(android.content.res.Configuration))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/res/Configuration.html configuration)` **This method is deprecated.** This library is no longer supported. |
| `abstract void` | `[notifyResized](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyResized(kotlin.Int,kotlin.Int))(int width, int height)` **This method is deprecated.** This library is no longer supported. |
| `abstract void` | `[notifySessionRendered](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifySessionRendered(kotlin.collections.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/java/lang/String.html> supportedSignalOptions )` **This method is deprecated.** This library is no longer supported. |
| `abstract void` | `[notifyUiChanged](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyUiChanged(android.os.Bundle))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html uiContainerInfo)` **This method is deprecated.** This library is no longer supported. |
| `abstract void` | `[notifyZOrderChanged](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyZOrderChanged(kotlin.Boolean))(boolean isZOrderOnTop)` **This method is deprecated.** This library is no longer supported. |

## Public methods

### close

Added in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17) Deprecated in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17)

```
abstract void [close](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#close())()
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Close this session, indicating that the remote provider of content should dispose of associated resources and that the `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.SessionClient` should not receive further callback events.

### getSignalOptions

Added in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17) Deprecated in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17)

```
abstract @NonNull Set<@NonNull String> [getSignalOptions](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#getSignalOptions())()
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

The set of options that will be used to determine what information is calculated and sent to `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserver`s attached to this session.

This value should not be directly set by UI providers. Instead, the registration of any `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory` will indicate that information should be calculated for this session.

### getView

Added in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17) Deprecated in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17)

```
abstract @NonNull View [getView](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#getView())()
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Return the `https://developer.android.com/reference/android/view/View.html` that presents content for this session. The same view will be returned for the life of the session object. Accessing `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#view()` after `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#close()` may throw an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html`.

### notifyConfigurationChanged

Added in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17) Deprecated in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17)

```
abstract void [notifyConfigurationChanged](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyConfigurationChanged(android.content.res.Configuration))(@NonNull Configuration configuration)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Notify the session that the host configuration has changed to `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyConfigurationChanged(android.content.res.Configuration)`.

### notifyResized

Added in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17) Deprecated in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17)

```
abstract void [notifyResized](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyResized(kotlin.Int,kotlin.Int))(int width, int height)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Notify the provider that the size of the host presentation area has changed to a size of `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyResized(kotlin.Int,kotlin.Int)` x `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyResized(kotlin.Int,kotlin.Int)` pixels.

### notifySessionRendered

Added in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17) Deprecated in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17)

```
abstract void [notifySessionRendered](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifySessionRendered(kotlin.collections.Set))(
    @NonNull Set<@NonNull String> supportedSignalOptions
)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Notifies that the session has been rendered inside the container hosting this session.

`https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifySessionRendered(kotlin.collections.Set)` specifies the signal options which are supported by the host container.

UI providers should add `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory`s to receive this value rather than using this method directly. This API is used to notify the `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserver`s associated with this session about the supported signal options for this session.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapterSignalOptions` |   |

### notifyUiChanged

Added in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17) Deprecated in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17)

```
abstract void [notifyUiChanged](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyUiChanged(android.os.Bundle))(@NonNull Bundle uiContainerInfo)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Notify the session when the presentation state of its UI container has changed.

`https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyUiChanged(android.os.Bundle)` contains a Bundle that represents the state of the container. The exact details of this Bundle depend on the container this Bundle is describing. This notification is not in real time and is throttled, so it should not be used to react to UI changes on the client side.

UI providers should add `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory`s to observe UI changes rather than using this method directly.

### notifyZOrderChanged

Added in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17) Deprecated in [1.0.0-alpha17](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha17)

```
abstract void [notifyZOrderChanged](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyZOrderChanged(kotlin.Boolean))(boolean isZOrderOnTop)
```

> [!CAUTION]
> **This method is deprecated.**   
> This library is no longer supported.

Notify the provider that there's a change in the intended z order of the session UI and it is now set to `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyZOrderChanged(kotlin.Boolean)`.