# HandshakeInfo

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/HandshakeInfo.java+class:androidx.car.app.HandshakeInfo) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
public final class HandshakeInfo
```

<br />

*** ** * ** ***

A container for the information conveyed by the host after the handshake with the app is completed.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/HandshakeInfo#HandshakeInfo(java.lang.String,int)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html hostPackageName, int hostCarAppApiLevel)` Creates an instance of `https://developer.android.com/reference/androidx/car/app/HandshakeInfo`. |

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/car/app/HandshakeInfo#getHostCarAppApiLevel()()` Returns the negotiated API level that should be used to communicate with the host. |
| `@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/HandshakeInfo#getHostPackageName()()` Returns the host package name. |

## Public constructors

### HandshakeInfo

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

```
public HandshakeInfo(@NonNull String hostPackageName, int hostCarAppApiLevel)
```

Creates an instance of `https://developer.android.com/reference/androidx/car/app/HandshakeInfo`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html hostPackageName` | the host package name |
| `int hostCarAppApiLevel` | the API level that should be used to communicate with the host |

## Public methods

### getHostCarAppApiLevel

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

```
public int getHostCarAppApiLevel()
```

Returns the negotiated API level that should be used to communicate with the host.

### getHostPackageName

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

```
public @NonNull String getHostPackageName()
```

Returns the host package name.