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

*** ** * ** ***

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


```
abstract class AbstractSandboxedUiAdapter : SandboxedUiAdapter, SessionObserverFactoryRegistry
```

<br />

*** ** * ** ***

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

An abstract class that implements `https://developer.android.com/reference/kotlin/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/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter` directly.

## Summary

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

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

| ### Public functions |
|---|---|
| `final https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[addObserverFactory](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#addObserverFactory(androidx.privacysandbox.ui.core.SessionObserverFactory))(sessionObserverFactory: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory)` **This function is deprecated.** This library is no longer supported. |
| `final https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[removeObserverFactory](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#removeObserverFactory(androidx.privacysandbox.ui.core.SessionObserverFactory))(sessionObserverFactory: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory)` **This function is deprecated.** This library is no longer supported. |

| ### Public properties |
|---|---|
| `final https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory>` | `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#sessionObserverFactories()` **This property is deprecated.** This library is no longer supported. |

| ### Inherited functions |
|---|
| From [androidx.privacysandbox.ui.core.SandboxedUiAdapter](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter) |---|---| | `abstract https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[openSession](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))( 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. | |

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

```
[AbstractSandboxedUiAdapter](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#AbstractSandboxedUiAdapter())()
```

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

## Public functions

### addObserverFactory

```
final fun [addObserverFactory](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#addObserverFactory(androidx.privacysandbox.ui.core.SessionObserverFactory))(sessionObserverFactory: SessionObserverFactory): Unit
```

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

Adds a `https://developer.android.com/reference/kotlin/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/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory#create()` will be invoked to allow a new `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver` instance to be attached to the UI session. This `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver` will receive UI updates for the lifetime of the session. A separate `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory#create()` call will be made for each UI session.

### removeObserverFactory

```
final fun [removeObserverFactory](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/provider/AbstractSandboxedUiAdapter#removeObserverFactory(androidx.privacysandbox.ui.core.SessionObserverFactory))(sessionObserverFactory: SessionObserverFactory): Unit
```

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

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

If the `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory` was not previously added, no action is performed. Any existing `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver` instances that have been created by the `https://developer.android.com/reference/kotlin/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/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory#create()` will be made.

## Public properties

### sessionObserverFactories

```
final val sessionObserverFactories: List<SessionObserverFactory>
```

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