# 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
public class SessionInfo
```

<br />

*** ** * ** ***

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

## Summary

| ### Constants |
|---|---|
| `static final @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/SessionInfo` | `https://developer.android.com/reference/androidx/car/app/SessionInfo#DEFAULT_SESSION_INFO()` A default `https://developer.android.com/reference/androidx/car/app/SessionInfo` for the main display, used when the host is on a version that doesn't support this new class. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/SessionInfo#DISPLAY_TYPE_CLUSTER() = 1` The cluster display, usually located behind the steering wheel. |
| `static final int` | `https://developer.android.com/reference/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/androidx/car/app/SessionInfo#SessionInfo(int,java.lang.String)(int displayType, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html sessionId)` Creates a new `https://developer.android.com/reference/androidx/car/app/SessionInfo` with the provided `displayType` and ` sessionId`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/SessionInfo#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html obj)` |
| `int` | `https://developer.android.com/reference/androidx/car/app/SessionInfo#getDisplayType()()` Returns the type of display that the `https://developer.android.com/reference/androidx/car/app/Session` is rendering on. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/SessionInfo#getSessionId()()` Returns a session-stable ID, unique to the display that the `https://developer.android.com/reference/androidx/car/app/Session` is rendering on. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/Class.html<https://developer.android.com/reference/androidx/car/app/model/Template>>` | `https://developer.android.com/reference/androidx/car/app/SessionInfo#getSupportedTemplates(int)(int carAppApiLevel)` Returns the set of templates that are allowed for this `https://developer.android.com/reference/androidx/car/app/Session`, or `null` if there are no restrictions (ie. all templates are allowed). |
| `int` | `https://developer.android.com/reference/androidx/car/app/SessionInfo#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/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)

```
public static final @NonNull SessionInfo DEFAULT_SESSION_INFO
```

A default `https://developer.android.com/reference/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)

```
public static final int DISPLAY_TYPE_CLUSTER = 1
```

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)

```
public static final int DISPLAY_TYPE_MAIN = 0
```

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)

```
public SessionInfo(int displayType, @NonNull String sessionId)
```

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

## Public methods

### equals

```
public boolean equals(@Nullable Object obj)
```

### getDisplayType

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

```
public int getDisplayType()
```

Returns the type of display that the `https://developer.android.com/reference/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)

```
public @NonNull String getSessionId()
```

Returns a session-stable ID, unique to the display that the `https://developer.android.com/reference/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)

```
public @Nullable Set<Class<Template>> getSupportedTemplates(int carAppApiLevel)
```

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

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```