# SharedUiAdapter

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/SharedUiAdapter.kt+class:androidx.privacysandbox.ui.core.SharedUiAdapter) 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.SharedUiPresentationApi
interface SharedUiAdapter
```

<br />

*** ** * ** ***

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

An adapter that provides a communication channel between a UI provider and a client app, while the client is displaying shared UI, i.e. UI that can contain both client-owned and provider-owned elements.

## Summary

| ### Nested types |
|---|
| `interface https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter.Session : https://developer.android.com/reference/java/lang/AutoCloseable.html` **This interface is deprecated.** This library is no longer supported. |
| `interface https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter.SessionClient` **This interface is deprecated.** This library is no longer supported. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `[openSession](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter#openSession(java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SharedUiAdapter.SessionClient))( clientExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html, client: https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter.SessionClient )` **This function is deprecated.** This library is no longer supported. |

| ### Extension functions |
|---|---|
| `https://developer.android.com/reference/android/os/Bundle.html` | `@https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/ExperimentalFeatures.SharedUiPresentationApi https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter.[toCoreLibInfo](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter#(androidx.privacysandbox.ui.core.SharedUiAdapter).toCoreLibInfo())()` **This function is deprecated.** This library is no longer supported. |

## Public functions

### openSession

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 [openSession](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter#openSession(java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SharedUiAdapter.SessionClient))(
    clientExecutor: Executor,
    client: SharedUiAdapter.SessionClient
): Unit
```

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

Opens a new session to maintain connection with a UI provider. `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter#openSession(java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SharedUiAdapter.SessionClient)` will receive all incoming communication from the provider. All incoming calls to `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter#openSession(java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SharedUiAdapter.SessionClient)` will be made through the provided `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter#openSession(java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SharedUiAdapter.SessionClient)`.

## Extension functions

### SharedUiAdapter.toCoreLibInfo

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/BinderSharedUiAdapterDelegate.kt+function:toCoreLibInfo)

```
@ExperimentalFeatures.SharedUiPresentationApi
fun SharedUiAdapter.[toCoreLibInfo](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter#(androidx.privacysandbox.ui.core.SharedUiAdapter).toCoreLibInfo())(): Bundle
```

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

Provides a `https://developer.android.com/reference/android/os/Bundle.html` containing a Binder which represents a `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter`. The Bundle is sent to the client in order for the `https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SharedUiAdapter` to be used to maintain a connection with a UI provider.