# SessionObserverContext

# SessionObserverContext

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/SessionObserverContext.kt+class:androidx.privacysandbox.ui.core.SessionObserverContext)  
Added in[1.0.0-alpha16](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha16)

*** ** * ** ***

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

<br />

```
class SessionObserverContext
```

<br />

*** ** * ** ***

A class containing information that will be constant through the lifetime of a[SessionObserver](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver).

When[SessionObserver.onSessionClosed](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver#onSessionClosed())is called for the associated session observers, the resources of the[SessionObserverContext](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverContext)will be freed.

## Summary

|                                                                                                                                                                                                                                   ### Public constructors                                                                                                                                                                                                                                   |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SessionObserverContext](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverContext#SessionObserverContext(android.view.View,kotlin.collections.Set))`(view: `[View](https://developer.android.com/reference/android/view/View.html)`?, supportedSignalOptions: `[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)`>)` |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverContext#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverContext#hashCode())`()`                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverContext#toString())`()`                                                                                            |

|                                                                             ### Public properties                                                                              |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [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)`>` | [supportedSignalOptions](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverContext#supportedSignalOptions()) Returns the signal options which are supported by the container hosting the UI session.                                                                            |
| [View](https://developer.android.com/reference/android/view/View.html)`?`                                                                                                      | [view](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserverContext#view()) Returns the view that is presenting content for the associated[SandboxedUiAdapter.Session](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session). |

## Public constructors

### SessionObserverContext

Added in[1.0.0-alpha16](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha16)  

```
SessionObserverContext(view: View?, supportedSignalOptions: Set<String>)
```  

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

```
open fun hashCode(): Int
```  

### toString

```
open fun toString(): String
```  

## Public properties

### supportedSignalOptions

Added in[1.0.0-alpha16](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha16)  

```
val supportedSignalOptions: Set<String>
```

Returns the signal options which are supported by the container hosting the UI session.  

### view

Added in[1.0.0-alpha16](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ui#1.0.0-alpha16)  

```
val view: View?
```

Returns the view that is presenting content for the associated[SandboxedUiAdapter.Session](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session).

This value will be non-null if the[SandboxedUiAdapter.Session](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SandboxedUiAdapter.Session)and the[SessionObserver](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ui/core/SessionObserver)are created from the same process. Otherwise, it will be null.