# SessionObserverFactory

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/SessionObserverFactory.kt+class:androidx.privacysandbox.ui.core.SessionObserverFactory)  
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/core/SessionObserverFactory "View this page in Java")

<br />

```
interface SessionObserverFactory
```

<br />

*** ** * ** ***

| **This interface is deprecated.**   
| This library is no longer supported.

A factory that creates[SessionObserver](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver)instances that can be attached to a[SandboxedUiAdapter.Session](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session). Many[SessionObserver](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver)s may be created for the same[SandboxedUiAdapter.Session](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session).

## Summary

|                                               ### Public functions                                                |
|-------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SessionObserver](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver) | [create](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory#create())`()` Called if a new[SandboxedUiAdapter.Session](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session)has been opened by the[SandboxedUiAdapter](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter)that this factory is registered to. |

|                                                                                 ### Public properties                                                                                 |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open `[Set](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`>` | [signalOptions](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverFactory#signalOptions()) The set of signals that should be collected for each[SandboxedUiAdapter.Session](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session). |

## Public functions

### create

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 create(): SessionObserver
```

Called if a new[SandboxedUiAdapter.Session](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session)has been opened by the[SandboxedUiAdapter](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter)that this factory is registered to. This will not be called for sessions that are already open.  

## Public properties

### signalOptions

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)  

```
open val signalOptions: Set<String>
```

The set of signals that should be collected for each[SandboxedUiAdapter.Session](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session). This set of signals is defined by[SandboxedUiAdapterSignalOptions](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapterSignalOptions).

The set of signals that are supported by the client will be sent in the[SessionObserverContext](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverContext)object in[SessionObserver.onSessionOpened](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver#onSessionOpened(androidx.privacysandbox.ui.core.SessionObserverContext)).