# AbstractSandboxedUiAdapter

Artifact: [androidx.privacysandbox.ui:ui-provider](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter.kt+class:androidx.privacysandbox.ui.provider.AbstractSandboxedUiAdapter) 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 abstract class AbstractSandboxedUiAdapter implements SandboxedUiAdapter, SessionObserverFactoryRegistry
```

<br />

*** ** * ** ***

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

An abstract class that implements `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter` while abstracting away methods that do not need to be implemented by a UI provider.

UI providers should use this class rather than implementing `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter` directly.

## Summary

| ### Nested types |
|---|
| `public abstract class https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter.AbstractSession implements https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session` **This class is deprecated.** This library is no longer supported. |

| ### Public constructors |
|---|
| `[AbstractSandboxedUiAdapter](https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#AbstractSandboxedUiAdapter())()` **This method is deprecated.** This library is no longer supported. |

| ### Public methods |
|---|---|
| `final void` | `[addObserverFactory](https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#addObserverFactory(androidx.privacysandbox.ui.core.SessionObserverFactory))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory sessionObserverFactory )` **This method is deprecated.** This library is no longer supported. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory>` | `[getSessionObserverFactories](https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#getSessionObserverFactories())()` **This method is deprecated.** This library is no longer supported. |
| `final void` | `[removeObserverFactory](https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#removeObserverFactory(androidx.privacysandbox.ui.core.SessionObserverFactory))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory sessionObserverFactory )` **This method is deprecated.** This library is no longer supported. |

| ### Inherited methods |
|---|
| From [androidx.privacysandbox.ui.core.SandboxedUiAdapter](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SandboxedUiAdapter) |---|---| | `abstract void` | `[openSession](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/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. | |

## Public constructors

### AbstractSandboxedUiAdapter

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 [AbstractSandboxedUiAdapter](https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#AbstractSandboxedUiAdapter())()
```

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

## Public methods

### addObserverFactory

```
public final void [addObserverFactory](https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#addObserverFactory(androidx.privacysandbox.ui.core.SessionObserverFactory))(
    @NonNull SessionObserverFactory sessionObserverFactory
)
```

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

Adds a `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory` for tracking UI presentation state across UI sessions. This has no effect on already open sessions.

For each session that is created for the adapter after this call returns, `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory#create()` will be invoked to allow a new `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserver` instance to be attached to the UI session. This `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserver` will receive UI updates for the lifetime of the session. A separate `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory#create()` call will be made for each UI session.

### getSessionObserverFactories

```
public final @NonNull List<@NonNull SessionObserverFactory> [getSessionObserverFactories](https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#getSessionObserverFactories())()
```

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

### removeObserverFactory

```
public final void [removeObserverFactory](https://developer.android.com/reference/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#removeObserverFactory(androidx.privacysandbox.ui.core.SessionObserverFactory))(
    @NonNull SessionObserverFactory sessionObserverFactory
)
```

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

Removes a `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory`, if it has been previously added with `https://developer.android.com/reference/androidx/privacysandbox/ui/provider/SessionObserverFactoryRegistry#addObserverFactory(androidx.privacysandbox.ui.core.SessionObserverFactory)`.

If the `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory` was not previously added, no action is performed. Any existing `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserver` instances that have been created by the `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory` will continue to receive updates until their corresponding UI session has been closed. For any subsequent sessions created\], no call to `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SessionObserverFactory#create()` will be made.