# 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
public 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 |
|---|
| `public interface https://developer.android.com/reference/androidx/privacysandbox/ui/core/SharedUiAdapter.Session extends https://developer.android.com/reference/java/lang/AutoCloseable.html` **This interface is deprecated.** This library is no longer supported. |
| `public interface https://developer.android.com/reference/androidx/privacysandbox/ui/core/SharedUiAdapter.SessionClient` **This interface is deprecated.** This library is no longer supported. |

| ### Public methods |
|---|---|
| `abstract void` | `[openSession](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SharedUiAdapter#openSession(java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SharedUiAdapter.SessionClient))( @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/SharedUiAdapter.SessionClient client )` **This method is deprecated.** This library is no longer supported. |

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

## Public methods

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

```
abstract void [openSession](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SharedUiAdapter#openSession(java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SharedUiAdapter.SessionClient))(
    @NonNull Executor clientExecutor,
    @NonNull SharedUiAdapter.SessionClient client
)
```

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

Opens a new session to maintain connection with a UI provider. `https://developer.android.com/reference/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/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/androidx/privacysandbox/ui/core/SharedUiAdapter#openSession(java.util.concurrent.Executor,androidx.privacysandbox.ui.core.SharedUiAdapter.SessionClient)`.

## Extension functions

### SharedUiAdapterProxy.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
default final @NonNull Bundle SharedUiAdapterProxy.[toCoreLibInfo](https://developer.android.com/reference/androidx/privacysandbox/ui/core/SharedUiAdapter#(androidx.privacysandbox.ui.core.SharedUiAdapter).toCoreLibInfo())(@NonNull SharedUiAdapter receiver)
```

> [!CAUTION]
> **This method 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/androidx/privacysandbox/ui/core/SharedUiAdapter`. The Bundle is sent to the client in order for the `https://developer.android.com/reference/androidx/privacysandbox/ui/core/SharedUiAdapter` to be used to maintain a connection with a UI provider.