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

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session "View this page in Java")

<br />

```
interface SandboxedUiAdapter.Session : AutoCloseable
```

<br />

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

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

*** ** * ** ***

| **This interface is deprecated.**   
| This library is no longer supported.

A single session with the provider of remote content.

## Summary

|                             ### Public functions                              |
|-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [close](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#close())`()` Close this session, indicating that the remote provider of content should dispose of associated resources and that the[SessionClient](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.SessionClient)should not receive further callback events.                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [notifyConfigurationChanged](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyConfigurationChanged(android.content.res.Configuration))`(configuration: `[Configuration](https://developer.android.com/reference/android/content/res/Configuration.html)`)` Notify the session that the host configuration has changed to[configuration](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyConfigurationChanged(android.content.res.Configuration)).                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [notifyResized](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyResized(kotlin.Int,kotlin.Int))`(width: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, height: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Notify the provider that the size of the host presentation area has changed to a size of[width](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyResized(kotlin.Int,kotlin.Int))x[height](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyResized(kotlin.Int,kotlin.Int))pixels. |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [notifySessionRendered](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifySessionRendered(kotlin.collections.Set))`(supportedSignalOptions: `[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`>)` Notifies that the session has been rendered inside the container hosting this session.                                                                                                                                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [notifyUiChanged](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyUiChanged(android.os.Bundle))`(uiContainerInfo: `[Bundle](https://developer.android.com/reference/android/os/Bundle.html)`)` Notify the session when the presentation state of its UI container has changed.                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html) | [notifyZOrderChanged](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyZOrderChanged(kotlin.Boolean))`(isZOrderOnTop: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` Notify the provider that there's a change in the intended z order of the session UI and it is now set to[isZOrderOnTop](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyZOrderChanged(kotlin.Boolean)).                                                                                                                                                                                                           |

|                                                                             ### Public properties                                                                              |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`>` | [signalOptions](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#signalOptions()) The set of options that will be used to determine what information is calculated and sent to[SessionObserver](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver)s attached to this session. |
| [View](https://developer.android.com/reference/android/view/View.html)                                                                                                         | [view](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#view()) Return the[View](https://developer.android.com/reference/android/view/View.html)that presents content for this session.                                                                                                                                    |

## Public functions

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

```
fun close(): Unit
```

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

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

```
fun notifyConfigurationChanged(configuration: Configuration): Unit
```

Notify the session that the host configuration has changed to[configuration](https://developer.android.com/reference/kotlin/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)  

```
fun notifyResized(width: Int, height: Int): Unit
```

Notify the provider that the size of the host presentation area has changed to a size of[width](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#notifyResized(kotlin.Int,kotlin.Int))x[height](https://developer.android.com/reference/kotlin/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)  

```
fun notifySessionRendered(supportedSignalOptions: Set<String>): Unit
```

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

[supportedSignalOptions](https://developer.android.com/reference/kotlin/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[SessionObserverFactory](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory)s to receive this value rather than using this method directly. This API is used to notify the[SessionObserver](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver)s associated with this session about the supported signal options for this session.  

|                                                                     See also                                                                      |
|---------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [SandboxedUiAdapterSignalOptions](https://developer.android.com/reference/kotlin/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)  

```
fun notifyUiChanged(uiContainerInfo: Bundle): Unit
```

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

[uiContainerInfo](https://developer.android.com/reference/kotlin/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[SessionObserverFactory](https://developer.android.com/reference/kotlin/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)  

```
fun notifyZOrderChanged(isZOrderOnTop: Boolean): Unit
```

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

## Public properties

### signalOptions

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)  

```
val signalOptions: Set<String>
```

The set of options that will be used to determine what information is calculated and sent to[SessionObserver](https://developer.android.com/reference/kotlin/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[SessionObserverFactory](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory)will indicate that information should be calculated for this session.  

### view

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)  

```
val view: View
```

Return the[View](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[view](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#view())after[close](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session#close())may throw an[IllegalStateException](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html).