# 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
public final class DelegatingSandboxedUiAdapter implements SandboxedUiAdapter
```

<br />

*** ** * ** ***

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

A `https://developer.android.com/reference/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 |
|---|
| `public interface https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter.DelegateChangeListener` **This interface is deprecated.** This library is no longer supported. |

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

| ### Public methods |
|---|---|
| `final void` | `[addDelegateChangeListener](https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#addDelegateChangeListener(androidx.privacysandbox.ui.core.DelegatingSandboxedUiAdapter.DelegateChangeListener))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter.DelegateChangeListener listener )` **This method is deprecated.** This library is no longer supported. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html` | `[getDelegate](https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#getDelegate())()` **This method is deprecated.** This library is no longer supported. |
| `void` | `[openSession](https://developer.android.com/reference/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))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/content/Context.html context, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionData sessionData, int initialWidth, int initialHeight, boolean isZOrderOnTop, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/concurrent/Executor.html clientExecutor, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.SessionClient client )` **This method is deprecated.** This library is no longer supported. |
| `final void` | `[removeDelegateChangeListener](https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#removeDelegateChangeListener(androidx.privacysandbox.ui.core.DelegatingSandboxedUiAdapter.DelegateChangeListener))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter.DelegateChangeListener listener )` **This method is deprecated.** This library is no longer supported. |
| `final void` | `[updateDelegate](https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#updateDelegate(android.os.Bundle))(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/os/Bundle.html delegate)` **This method 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)

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

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

## Public methods

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

```
public final void [addDelegateChangeListener](https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#addDelegateChangeListener(androidx.privacysandbox.ui.core.DelegatingSandboxedUiAdapter.DelegateChangeListener))(
    @NonNull DelegatingSandboxedUiAdapter.DelegateChangeListener listener
)
```

> [!CAUTION]
> **This method 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)

```
public final @NonNull Bundle [getDelegate](https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#getDelegate())()
```

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

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

### openSession

```
public void [openSession](https://developer.android.com/reference/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))(
    @NonNull Context context,
    @NonNull SessionData sessionData,
    int initialWidth,
    int initialHeight,
    boolean isZOrderOnTop,
    @NonNull Executor clientExecutor,
    @NonNull SandboxedUiAdapter.SessionClient client
)
```

> [!CAUTION]
> **This method 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/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/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/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/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/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/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)

```
public final void [removeDelegateChangeListener](https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#removeDelegateChangeListener(androidx.privacysandbox.ui.core.DelegatingSandboxedUiAdapter.DelegateChangeListener))(
    @NonNull DelegatingSandboxedUiAdapter.DelegateChangeListener listener
)
```

> [!CAUTION]
> **This method 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)

```
public final void [updateDelegate](https://developer.android.com/reference/androidx/privacysandbox/ui/core/DelegatingSandboxedUiAdapter#updateDelegate(android.os.Bundle))(@NonNull Bundle delegate)
```

> [!CAUTION]
> **This method 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.