# SessionInfo

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/SessionInfo.java+class:androidx.car.app.SessionInfo) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

*** ** * ** ***


```
@RequiresCarApi(value = 6)
@CarProtocol
class SessionInfo
```

<br />

*** ** * ** ***

Information about a `https://developer.android.com/reference/kotlin/androidx/car/app/Session`, such as the physical display and the session ID.

## Summary

| ### Constants |
|---|---|
| `const https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo` | `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#DEFAULT_SESSION_INFO()` A default `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo` for the main display, used when the host is on a version that doesn't support this new class. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#DISPLAY_TYPE_CLUSTER() = 1` The cluster display, usually located behind the steering wheel. |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#DISPLAY_TYPE_MAIN() = 0` The primary infotainment display usually in the center column of the vehicle. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#SessionInfo(int,java.lang.String)(displayType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, sessionId: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Creates a new `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo` with the provided `displayType` and ` sessionId`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#equals(java.lang.Object)(obj: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#getDisplayType()()` Returns the type of display that the `https://developer.android.com/reference/kotlin/androidx/car/app/Session` is rendering on. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#getSessionId()()` Returns a session-stable ID, unique to the display that the `https://developer.android.com/reference/kotlin/androidx/car/app/Session` is rendering on. |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/kotlin/androidx/car/app/model/Template!>!>?` | `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#getSupportedTemplates(int)(carAppApiLevel: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Returns the set of templates that are allowed for this `https://developer.android.com/reference/kotlin/androidx/car/app/Session`, or `null` if there are no restrictions (ie. all templates are allowed). |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo#toString()()` |

## Constants

### DEFAULT_SESSION_INFO

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
const val DEFAULT_SESSION_INFO: SessionInfo
```

A default `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo` for the main display, used when the host is on a version that doesn't support this new class.

### DISPLAY_TYPE_CLUSTER

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
const val DISPLAY_TYPE_CLUSTER = 1: Int
```

The cluster display, usually located behind the steering wheel. Note: There can be more than one cluster session running in case of multi display cars.

### DISPLAY_TYPE_MAIN

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
const val DISPLAY_TYPE_MAIN = 0: Int
```

The primary infotainment display usually in the center column of the vehicle.

## Public constructors

### SessionInfo

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
SessionInfo(displayType: Int, sessionId: String)
```

Creates a new `https://developer.android.com/reference/kotlin/androidx/car/app/SessionInfo` with the provided `displayType` and `
sessionId`.

## Public functions

### equals

```
fun equals(obj: Any?): Boolean
```

### getDisplayType

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
fun getDisplayType(): Int
```

Returns the type of display that the `https://developer.android.com/reference/kotlin/androidx/car/app/Session` is rendering on.

### getSessionId

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
fun getSessionId(): String
```

Returns a session-stable ID, unique to the display that the `https://developer.android.com/reference/kotlin/androidx/car/app/Session` is rendering on.

### getSupportedTemplates

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.3.0)

```
fun getSupportedTemplates(carAppApiLevel: Int): (Mutable)Set<Class<Template!>!>?
```

Returns the set of templates that are allowed for this `https://developer.android.com/reference/kotlin/androidx/car/app/Session`, or `null` if there are no restrictions (ie. all templates are allowed).

### hashCode

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

### toString

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