# DelegatingSandboxedUiAdapter

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/DelegatingSandboxedUiAdapter.kt+class:androidx.privacysandbox.ui.core.DelegatingSandboxedUiAdapter) 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)

*** ** * ** ***

<br />

```
@ExperimentalFeatures.DelegatingAdapterApi
class DelegatingSandboxedUiAdapter : SandboxedUiAdapter
```

<br />

*** ** * ** ***

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

A `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter` that helps delegate calls to other uiAdapters.

When this adapter is set to the client's container, the adapter can switch the delegate uiAdapter, that serves the `Session`, without involving the client. For each new delegate, a session would be requested with all clients of this adapter.

One example use-case of these kind of UIAdapters is to support updating the provider of the UI without the client's involvement.

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter.DelegateChangeListener` **This interface is deprecated.** This library is no longer supported. |

| ### Public constructors |
|---|
| `[DelegatingSandboxedUiAdapter](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#DelegatingSandboxedUiAdapter(android.os.Bundle))(delegate: https://developer.android.com/reference/android/os/Bundle.html)` **This function is deprecated.** This library is no longer supported. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[addDelegateChangeListener](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#addDelegateChangeListener(androidx.privacysandbox.ui.core.DelegatingSandboxedUiAdapter.DelegateChangeListener))( listener: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter.DelegateChangeListener )` **This function is deprecated.** This library is no longer supported. |
| `https://developer.android.com/reference/android/os/Bundle.html` | `[getDelegate](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#getDelegate())()` **This function is deprecated.** This library is no longer supported. |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[openSession](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#openSession(android.content.Context,androidx.privacysandbox.ui.core.SessionData,kotlin.Int,kotlin.Int,kotlin.Boolean,java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SandboxedUiAdapter.SessionClient))( context: https://developer.android.com/reference/android/content/Context.html, sessionData: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionData, initialWidth: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, initialHeight: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, isZOrderOnTop: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, clientExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html, client: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.SessionClient )` **This function is deprecated.** This library is no longer supported. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[removeDelegateChangeListener](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#removeDelegateChangeListener(androidx.privacysandbox.ui.core.DelegatingSandboxedUiAdapter.DelegateChangeListener))( listener: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter.DelegateChangeListener )` **This function is deprecated.** This library is no longer supported. |
| `suspend https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[updateDelegate](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#updateDelegate(android.os.Bundle))(delegate: https://developer.android.com/reference/android/os/Bundle.html)` **This function is deprecated.** This library is no longer supported. |

## Public constructors

### DelegatingSandboxedUiAdapter

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)

```
[DelegatingSandboxedUiAdapter](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#DelegatingSandboxedUiAdapter(android.os.Bundle))(delegate: Bundle)
```

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

## Public functions

### addDelegateChangeListener

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 [addDelegateChangeListener](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#addDelegateChangeListener(androidx.privacysandbox.ui.core.DelegatingSandboxedUiAdapter.DelegateChangeListener))(
    listener: DelegatingSandboxedUiAdapter.DelegateChangeListener
): Unit
```

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

### getDelegate

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 [getDelegate](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#getDelegate())(): Bundle
```

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

Fetches the current delegate which is a `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter` Bundle.

### openSession

```
open fun [openSession](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#openSession(android.content.Context,androidx.privacysandbox.ui.core.SessionData,kotlin.Int,kotlin.Int,kotlin.Boolean,java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SandboxedUiAdapter.SessionClient))(
    context: Context,
    sessionData: SessionData,
    initialWidth: Int,
    initialHeight: Int,
    isZOrderOnTop: Boolean,
    clientExecutor: Executor,
    client: SandboxedUiAdapter.SessionClient
): Unit
```

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

Open a new session for displaying content with an initial size of `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter#openSession(android.content.Context,androidx.privacysandbox.ui.core.SessionData,kotlin.Int,kotlin.Int,kotlin.Boolean,java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SandboxedUiAdapter.SessionClient)`x`https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter#openSession(android.content.Context,androidx.privacysandbox.ui.core.SessionData,kotlin.Int,kotlin.Int,kotlin.Boolean,java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SandboxedUiAdapter.SessionClient)` pixels. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter#openSession(android.content.Context,androidx.privacysandbox.ui.core.SessionData,kotlin.Int,kotlin.Int,kotlin.Boolean,java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SandboxedUiAdapter.SessionClient)` will receive all incoming communication from the provider of content. All incoming calls to `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter#openSession(android.content.Context,androidx.privacysandbox.ui.core.SessionData,kotlin.Int,kotlin.Int,kotlin.Boolean,java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SandboxedUiAdapter.SessionClient)` will be made through the provided `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter#openSession(android.content.Context,androidx.privacysandbox.ui.core.SessionData,kotlin.Int,kotlin.Int,kotlin.Boolean,java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SandboxedUiAdapter.SessionClient)`. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter#openSession(android.content.Context,androidx.privacysandbox.ui.core.SessionData,kotlin.Int,kotlin.Int,kotlin.Boolean,java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SandboxedUiAdapter.SessionClient)` tracks if the content surface will be placed on top of its window

### removeDelegateChangeListener

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 [removeDelegateChangeListener](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#removeDelegateChangeListener(androidx.privacysandbox.ui.core.DelegatingSandboxedUiAdapter.DelegateChangeListener))(
    listener: DelegatingSandboxedUiAdapter.DelegateChangeListener
): Unit
```

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

### updateDelegate

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)

```
suspend fun [updateDelegate](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#updateDelegate(android.os.Bundle))(delegate: Bundle): Unit
```

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

Updates the delegate and notifies all listeners to process the update. If any listener fails process refresh we throw `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html`. Cancellation of this API does not propagate to the client side.